in reply to Superfluous subpatterns in regex alternations.
But to issue the warning you want, the regex engine would have to post-process the regex, to make sure it IS equivalent, and no one slipped in anything after the closing ).
And even then, how would you deal with qr//?
Given:
you couldn't optimize $re to /(LIST|OF)/, since you don't know where it will be used, right?$re=qr/(LIST|OF|LISTS)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Superfluous subpatterns in regex alternations.
by demerphq (Chancellor) on Jan 03, 2005 at 12:55 UTC |