I have a string where there are sections with double quotes.Im trying to replace all the double quotes with single quotes except ones that have escaping ie: \"
.
I'm trying to build a regex that matches all "
except ones that comes like \"
So when I use preg_replace
I will get as follows.
"love" -> 'love'
"John said \"HI\"" - > 'John said \"HI\"'
I have tried the following which does exactly the opposite.
[<^\\]"