Re: RFC 72 (v2) The regexp engine should go backward as well as forward.
[email protected] ("Mike Mulligan")
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Organization | Northern Light Technology, Inc |
| Message-ID | <[email protected]> |
From: "Peter Heslin" <[email protected]> Sent: Thursday, August 31, 2000 10:51 PM > I would propose that your version of the syntax might also function in > the middle of a regexp: /GHI(?`<=DEF)JKL(?`<=^ABC)MNO/ would match the > start of the alphabet (fixed-length example used for simplicity). That's not what I had in mind; I would have the new look-behind look (in terms of left-to-right placement) and act like the existing (?<=pat), except that it would have non-zero width and create a back-reference. The example above would (if we remove the ^ ) match GHIDEFJKLABCMNO Hmm, that non-zero width thing is screwy. The zero-width analog, /GHI(?<=DEF)JKL(?<=^ABC)MNO/, would NEVER match. That asks for a GHI immediately followed by a JKL immediately preceeded by a DEF. Without some better motivating examples, I'd rather keep the old and proposed look-behinds working the same. So let me retract what I said above about matching GHIDEFJKLABCMNO A match would be had with /GHI.*(?`<=DEF)JKL.*(?`<=ABC)MNO/ mike mulligan