Re: What should /\08/ match and do?
[email protected] (Nicholas Clark)
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 01, 2010 at 10:38:10PM +0200, demerphq wrote: > On 1 June 2010 22:30, Abigail <[email protected]> wrote: > > On Tue, Jun 01, 2010 at 11:52:38AM -0600, karl williamson wrote: > > This one is sneaky as well: > > > > Â Â $a = '(.)\1'; > > Â Â "aa" =~ /${a}/; Â Â Â # True > > Â Â "aa0" =~ /${a}0/; Â Â # False! > > Â Â "aa\x8" =~ /${a}0/; Â # True! > > Wow. Those are gnarly. Thats a great example of why using old style > back refs is dangerous. Might even be worth adding to the docs? Or, alternatively, that interpolation is happening too early in regexp compilation, such that it's possible to produce syntactically valid constructions by co-incidence. (A bit like, IIRC, \N{} escapes being interpolated, and then treated as metacharacters) Nicholas Clark