Re: RFC 72 (v2) The regexp engine should go backward as well as forward.
[email protected] (Hugo) Tue, 12 Sep 2000 04:28:09 +0100
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
mike mulligan writes: :If it important to be able to do both: : : $large = join '|', @possible' : $data =~ / (?<= $large) GAAC /x; # Don't care which @possible? : :and : : $data =~ m/ ($large) GAAC /x; # Need $1 to say which @possible : :Then perhaps a back-reference-setting look-behind could be implemented? :Don't have an obvious syntax to use (back-tick == back-reference?), but :something like: : : $data =~ m/ (?`<= $large) GAAC /x; # Need $1 to say which @possible : :Does this ehanced look-behind satisfy the RFC's needs? Note that you can already get backreferences out of zero-width assertions. Like the Tardis, it only looks zero-width from the outside: "test" =~ /(?<=(t))(.)/ and print $1, $2; Hugo