Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- lookahead bug (at least in 5.8.4)
June 11, 2007, 4:09 pm
rate this thread
Re: lookahead bug (at least in 5.8.4)
The 2nd word of the description in the docs explains that:
A zero-width positive look-ahead assertion.
I'll use <> to mark the regex engine's current position.
We begin at the start of the string:
We do a successful *zero-width* look ahead on .*a
(the current position did not advance because that is what zero-width means)
Now we need to match a "b" next, but there is an "a" next. Cannot match here.
Since the pattern is not anchored, we advance one character
and try again.
But now we can't match the .*a lookahead expression, so the match must fail.
Same reason for both of those.
Let's do that one too:
We do a successful zero-width look ahead on .*b
Now we need to match an "a" next, and there is an "a" next. Match succeeds.
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"