# old: # $string =~ s/([^Y])X/$1/g; # new: $string =~ s/[^Y]\KX//;