deprecated has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to remove line wrapping from files that contain something like this:sub zapwrap { my ($line, $next_line) = (@_); return undef unless $line =~ /^#(#|=)+$/; return undef unless $next_line =~ /(?:$1)+/; return 1; }
(hopefully your browser will have wrapped that line). I think I have the RE for it, I just sort of thought this one up. My question is whether in the second one, I have to ?: (forget) the saved value or if the $1 gets interpolated _before_ the value of that expression gets evaluated. It seems silly in that it has to interpolate it before it can evaluate it, but I suspect something strange might happen in the internal workings of the PCRE. :)###################################################################### +######################## # or ... #===================================================================== +========================
thanks
brother dep.
--
Laziness, Impatience, Hubris, and Generosity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp syntax nuance question, storing $1 (code)
by japhy (Canon) on May 02, 2001 at 23:17 UTC | |
|
Re: Regexp syntax nuance question, storing $1 (code)
by tye (Sage) on May 02, 2001 at 23:34 UTC | |
|
Re: Regexp syntax nuance question, storing $1 (code)
by cLive ;-) (Prior) on May 03, 2001 at 00:23 UTC |