Regex to replaces slashes inside of JSON
To replace single backslashes with double backslashes, but leave existing doubles alone, search for
(?<!\\)\\(?!\\)
and replace that with
\\\\
For C#, RegexBuddy creates this code snippet:
resultString = Regex.Replace(subjectString, @"(?<!\\) # lookbehind: Check that previous character isn't a \ \\ # match a \ (?!\\) # lookahead: Check that the following character isn't a \", @"\\", RegexOptions.IgnorePatternWhitespace);