hello folks,
I'm slurping in a large file and seeing a nice speedup versus line by line
processing...but I'm losing it in my (likely poorly constructed!)
reg-expression match
I do: -
#
# look for potentially problematic code of the following form: -
# STW b0, *SP--[3]
# The reg exp tries to match: -
# - anything up until 'ST' (so that we match STH, STW, STDW etc) followed by
# - 1+ non-whitespace chars followed by
# - 0+ whitespace chars followed by
# - 0+ non-whitespace chars followed by
# the string 'B15--' followed by
# anything up until an odd single-digit number followed by
# the ']' character
# Matches all occurrences
#
my @match_sp = $all_lines =~ /.*ST\S+\s*\S*B15--.*[^02468]]/mg;
...and then I foreach on @match_sp to show all occurrences found...
Any speedup tips most welcome. Would also appreciate a brief explanation of
why this reg ex is slow (so I dont screw it up next time!)
Many thanks, Alan
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.