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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -