I have the following string and I want to escape backslash between the double quotes only. I tried doing this,
String s = "Hello\na = a.split(\"\n\")";
String tem = s.replaceAll("(?<=\")[^\\\\](?=\")", "\\\\");
But I get the following output,
# output
Hello
a = a.split("\")
I want it to be,
Hello
a = a.split("\n")
Any idea on this?