Perl extended regexp problems...
liyang at nerv.cx
Sun Sep 16 04:12:30 CDT 2001
liyang at sakura:~$ echo -e "foobar\ncowbar\ncowmoo" \
| perl -ne 'print if /(?<!=cow)bar/x'
liyang at sakura:~$
I've read the FM, and my interpretation of that pattern is ``match
all occurrences of `bar' not immediately prefixed by `cow'.''
Shouldn't the answer be just `foobar'?
How am I supposed to do this? (given the constraint that you've
only got one regex to accomplish the task...)
.----| Liyang Hu /aka/ DenseBoy |---| http://www.nerv.cx/ |----.
| Real programs don't eat cache. |
More information about the Belfast-pm