Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Mind boggling regexby earthboundmisfit (Chaplain) |
on Oct 26, 2001 at 18:05 UTC ( [id://121630]=note: print w/replies, xml ) | Need Help?? |
My uninformed guess is that it has to do with look ahead. If you hard code the 'e' it behaves as it should:
My understanding was that you could not use a reference to the matched result until after the pattern has matched. I eagerly await the real answer from those who know update: didn't have to wait long for that one. Should have practiced some look behind ;) update2: As usual, I've confused my terminology. In studying japhy's answer it looks like I had the right idea, but really what it comes down to is that ([^\1]) is the wrong way to do a negative lookahead Pg. 203 of the Camel Book (3rd edition) offers a good explanation of this.
In Section
Seekers of Perl Wisdom
|
|