length($pat) && ($msg =~ s/$pat/$replace/mg);