fork download
  1. $s1 = $s2 = "foo\(bar\)";
  2.  
  3. $b1 = "foo\(bar\)";
  4. $s1 =~ s/\Q$b1\E/replace/;
  5. print "$s1\n";
  6.  
  7. $b2 = qr/foo\(bar\)/;
  8. $s2 =~ s/$b2/replace/;
  9. print "$s2\n";
  10.  
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
replace
replace