in reply to How to not match some words but match all the others
Here's yet another example of how to replace something, but not everything without a loop.
$txt =~ s/($replacethis)/($1 ne "notthis" && $1 ne "nothistoo") ? "wit +hthis" : $1/ge; [download]