in reply to Re: Escape $ inside quotes only
in thread Escape $ inside quotes only

This fails for me with multiple escaped " inside string. For example:

my $str = <<'EOS'; "\"$x\"" EOS $str =~ s[("[^"]*?(?<!\\)")] { (my $temp = $1) =~ s[(?<!\\)\$][\Q\$]g; $temp; }mge; print $str;

does not escape the $.