in reply to Incremental replacement by regex

Assuming the target string is in $_:
my $i; s/example\K/'_' . ++$i/eg;