$txt =~ s/($replacethis)/($1 ne "notthis" && $1 ne "nothistoo") ? "withthis" : $1/ge;