in reply to Re: negate pattern match
in thread negate pattern match
I need to reject records where the word immediately before "train times" is help. If help is used in the text it would always be the first word in the record. So only record two & four in my example would be printed. I tried doing thishelp train times from xyz load train times including xyz help train times including xyz book train times at 1234
Based on other comments I've read it seems that the use of negative lookbehind assertion should be discouraged but I'm not sure how to handle this without doing an assertion ?print if /(?<!help).*train times/; #doesn't work print if /^(!help).*train times/; # doesn't work either
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: negate pattern match
by GrandFather (Saint) on Jan 31, 2006 at 18:39 UTC | |
by Anonymous Monk on Feb 02, 2006 at 10:56 UTC |