我无法在sed中替换双反斜杠后跟引号\\'
。 这是我的当前命令:
echo file.txt | sed "s:\\\\':\\':g"
上述命令不仅将
\\'
替换为\'
,还将\'
替换为'
如何只替换完全匹配的内容?输入:
'one', 'two \\'change', 'three \'unchanged'
预期结果:
'one', 'two \'change', 'three \'unchanged'
实际情况:
'one', 'two \'change', 'three 'unchanged'
\'
替换为'
。 - Jardalu