my $string = 'abcdef'; my $match = '[a-z]'; $string =~ s/\Q$match/NOT REPLACED/; print "$string\n"; $string =~ s/$match/REPLACED/; print "$string\n"; __OUTPUT__ abcdef REPLACEDbcdef #### perldoc perlre