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;
In reply to Re^2: Incremental replacement by regex
by markdibley
in thread Incremental replacement by regex
by markdibley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |