regex - Replace a double backslash followed by quote (\\') using sed? -


i unable replace double backslash followed quote \\' in sed. current command

echo file.txt | sed "s:\\\\':\\':g" 

the above command not replaces \\' \' replaces \' '

how replace exact match?

input:

'one', 'two \\'change', 'three \'unchanged' 

expected:

'one', 'two \'change', 'three \'unchanged' 

actual:

'one', 'two \'change', 'three 'unchanged' 

$ sed "s/\\\\\\\'/\\\'/g" file 'one', 'two \'change', 'three \'unchanged' 

here discussion on why sed needs 3 backslashes one


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -