in reply to Re: Pattern matching when there are exception strings
in thread Pattern matching when there are exception strings
My first thought is to do a global replacement of all the exceptions, to remove them from the data. Then search what's left for the strings you do want to count. Performance-wise I don't know how great this would be, but it's easier to read (and possibly easier to write if it needs to be automated for a large amount of search strings).
while(<>){ s/(?:_|#|XL5 )ALPHA//g; print if /ALPHA/; }
edit: davidrw beat me to it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Pattern matching when there are exception strings
by Roy Johnson (Monsignor) on Sep 21, 2005 at 13:45 UTC |