in reply to solution to: Re: japhy has met his match
in thread japhy has met his match

Close, but not quite yet:

First, here's a 5.005 version that's the same thing:

$regex = '^(.*)(?(?{my$x=substr$1,9,-4;$1ne"^(.*)(?(?{$x}))\\z"}))\z';
And here's the stinger:
$test = '^(.*)(?(?{my$japhy;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...)

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.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain