Perlstorm #0040
[email protected] (Richard Proctor) Sat, 23 Sep 2000 20:28:14 +0100 (BST)
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
TomCs perl storm has: > Figure out way to do > > /$e1 $e2/ > > safely, where $e1 might have '(foo) \1' in it. > and $e2 might have '(bar) \1' in it. Those won't work. If e1 and e2 are qr// type things the answer might be to localise the backref numbers in each qr// expression. If they are not qr//s it might still be possible to achieve if the expansion of variables in regexes is done by the regex compiler it could recognise this context and localise the backrefs. Any code like this is going to have real problem with $1 etc if used later, use of assignment in a regex and named backrefs (RFC 112) would make this a lot safer. Richard -- [email protected]