in reply to Superfluous subpatterns in regex alternations.
That option can match any time the regex engine has picked the first one but is forced to backtrack into the alternation. gaal gave you one example. Here are some artificial ones where the LIST option will never match but the LISTS one may:
/ (LIST|OF|LISTS) (?!S) /x / (LIST|OF|LISTS) (?(?{ $+ eq "LIST" }) (?!) ) /x
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Superfluous options in regex alternations.
by demerphq (Chancellor) on Jan 03, 2005 at 12:48 UTC |