in reply to regex, use of lookaround for whole word filtering
Simple:
!/neither.*nor/ && /nor/
Complicated (and surely slower):
/^(?:(?!neither).)*nor/
Update: Oops, they're not quite equivalent.
The first will match when no "neither" is found before the last "nor".
The second will match when no "neither" is found before the first "nor".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex, use of lookaround for whole word filtering
by aquarium (Curate) on Aug 11, 2010 at 03:35 UTC | |
by ikegami (Patriarch) on Aug 11, 2010 at 03:45 UTC | |
by choroba (Cardinal) on Aug 11, 2010 at 10:36 UTC |