On Mar 23, 2005, at 2:59 PM, Brian Deacon wrote:

The bigger problem is the repeating of "crazy".  What would be the
coolest would be if regex would let me variablize the "crazy" regex and
then let me refer to it later.

I think you can, but I'm not sure you want to.

IIRC, Perl has a syntax where you can tuck an earlier match into a named variable and use it again later in the same expression. This, of course, means that you can no longer compile the expression since it now has a run time component.

However, doesn't Perl let you interpolate a variable into a regex string? It's been a while, but I'm pretty sure you could do this even back in the 4.X days.

It's Perl.  Remember, TMTOWTDI.

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to