Re: RFC 72 (v3) Variable-length lookbehind: the regexp engine should also go backward.

[email protected] (Hugo) Tue, 12 Sep 2000 04:59:00 +0100
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
mike mulligan replied to Peter Heslin:
:> Simply put, I want variable-length lookbehind.
:
:The RFC seems to say you want this so that you can optimize the operation of
:the regex execution.  I've been looking at the existing fixed-length
:look-behind and see that it does not seem to operate the way you may have
:assumed.
:
:In particular, it is greedy in the sense of the forward matching "*" or "+"
:constructs.
[...]
:$ perl "-Dr" -e "print qq($&\n) if qq(mxnxxxxoxxx) =~ /(?<=[aeiou])x*/"
[snip]

This is nothing to do with greediness and everything to do with
left-to-rightness. The regexp engine does not look for x* except
in those positions where the lookbehind has already matched.

Hugo