in reply to
Incremental replacement by regex
Assuming the target string is in
$_
:
my $i; s/example\K/'_' . ++$i/eg;
[download]
Comment on
Re: Incremental replacement by regex
Select
or
Download
Code
In Section
Seekers of Perl Wisdom