$orig='aaa([\+\-]{1})bbb'; $res = '([\\+\\-]{'; $qres = '\\Q$res\\E'; $str=$orig; $str =~ s!\Q$res\E!!; print "Replace against variable quoted => $res <=: $str\n"; $str=$orig; $str =~ s!$qres!!; print "Replace against variable quoted => $qres <=: $str\n";