I have this text
'Random Text', 'a\nb\\c\'d\\', 'ok'
I want him to become
'Random Text', 'a\nb\c''d\', 'ok'
The problem is coming out. Instead of escaping with \ , now I only run away with ' c '' . This is for a third-party program, so I canβt change it, so you need to change one screening method to another.
Problem \\' . If I replace the string, it will become \'' , not \' . Also, \n not a newline, but the actual text \n , which should not be changed. I tried using a regex, but I could not think of a way to say whether to replace ' with '' else if \\ replace with \ . Obviously, doing this in two steps creates a problem.
How to replace this line?
user34537
source share