What’s the regular expression to find \"
I think it’s this: '/\\"/' but I need to use it on a really large dataset so need to make sure this is correct.
I need to replace it with " so my code is : $data = preg_replace('/\\"/', '"', $data)
Is that correct?
For matching backslashes you need to ‘double-escape’ them, so you have four
\at the end:Why you need 4
\: PHP parses a string\\"as\"and RegEx interprets this as"since in RegEx you don’t need to escape". So it wont match\".\\\\"will be parsed as\\"which will be interpreted as\"by RegEx.