in reply to solution to: Re: japhy has met his match
in thread japhy has met his match
First, here's a 5.005 version that's the same thing:
And here's the stinger:$regex = '^(.*)(?(?{my$x=substr$1,9,-4;$1ne"^(.*)(?(?{$x}))\\z"}))\z';
(Mind you, I'm playing with this on 5.005, and things that I don't expect to match are matching - I wonder if there's a bug in the RE engine at this point. However, I'm pretty sure that adding any text prior to "my$x..." will still match...)$test = '^(.*)(?(?{my$japhy;my$x=substr$1,9,-4;$1ne"^(.*)(??{$x}))\\z +"}))\z';
I think that you need to specify the exact length of the substr that you're looking at, which means to just simply do some character counting.
|
|---|