in reply to Re: Modifying the match position after each match
in thread Modifying the match position after each match
should be$string =~ s/(_)[^']/$1'/g;
That can also be written as$string =~ s/(_)([^'])/$1'$2/g;
and$string =~ s/(_)(?=[^'])/$1'/g;
$string =~ s/_\K(?=[^'])/'/g; # 5.10+
|
|---|