in reply to Re: Incremental replacement by regex
in thread Incremental replacement by regex
my $t = "This example could be another example where the example is th +e example I wanted\n"; my $count = 0; while($t =~ /example\s/){ my $example = "example_".++$count; $t =~ s/(example\s)/$example /; print $t; } print $t;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Incremental replacement by regex
by cdarke (Prior) on Feb 21, 2011 at 14:18 UTC |