in reply to Re: multiple matches with regexp
in thread multiple matches with regexp
I got interested in why a negative look-ahead was required, and found that negative and positive failing look-behinds work too, but a simple mis-match doesn't, and neither does a failing zero-length positive look-ahead: (?=x). For example, m/(aa)(?{push @a, $1})x/ does not work. Presumably the regex optimiser sees that there is no 'x' in 'aaaa', so it doesn't bother with the step-wise attempts to match the 'a's.
Is it possible a future regex engine will realise that mis-match is inevitable because (?!) will always mis-match, and break this code?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: multiple matches with regexp
by CombatSquirrel (Hermit) on Oct 10, 2003 at 22:04 UTC | |
by almaric (Acolyte) on Oct 11, 2003 at 17:25 UTC |