in reply to Greedy Substitution Within a Defined Range
Do it in two steps.
my $text =~ s[(?<=BEGIN_MARKER)(.*?)(?=END_MARKER)]{ (my $rep = $1) =~ s[i][x]g; # For single char subs you could use t +r// here $rep; }ge; print $text; An abitrary BEGIN_MARKER strxng whxch END_MARKER could contain BEGIN_M +ARKER just about END_MARKER anything
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Greedy Substitution Within a Defined Range
by diotalevi (Canon) on Apr 21, 2004 at 13:35 UTC | |
by Anonymous Monk on Apr 21, 2004 at 19:17 UTC |