I want to replace double quotes with single quotes if they aren't surrounded by single qoutes using PCRE. Some examples, the meaning is input => output
"foo" => 'foo'
'foo' => 'foo'
abc "foo" => abc 'foo'
foo "bar", "baz" => foo 'bar', 'baz'
abc 'foo "bar" baz' => abc 'foo "bar" baz'
I tried ^([^'"]*)"([^'"]*)"
with the modifiers m multi-line
and 'g global`. This works as far as there isn't more than one "xyz" block per line (fails in line 4).
EDIT: I forgot to mention that my current substitution is $1'$2'