in reply to Simple Substitution
Looking from that angle, might it be easier to substitute on the (apparently unambiguous) +eol\d'
update: belated example:
#!usr/bin/perl -w $foo = <DATA>; $foo =~ s/\+eol\d'/\n/g; print $foo; print "\n\n Done\n"; __DATA__ AAA+XXXX+1234++here?'s some text+eol1'BBB+XXXX+1234++here?'s some text ++eol2'CCC+XXXX+1234++here?'s some text+eol3'etc.
# OUTPUT: # # AAA+XXXX+1234++here?'s some text # BBB+XXXX+1234++here?'s some text # CCC+XXXX+1234++here?'s some text # etc. # # Done
The following notion is mine, and may not be wise (CORRECTIVE comments welcome!):
It's usually worthwhile to match against the largest possible chunk of data, to minimize ambiguity for the regex.
|
|---|