【发布时间】:2015-12-11 16:42:33
【问题描述】:
我有一个像这样的文件,我需要用 sed 命令替换所有字符串行,例如,我想在“Branglebracken”上使用 sed 并替换为其他想要的文本,但我不想在什么时候替换它这个词包含在其他字符串中。我的意思是我只需要在单词单独时替换它,而不是当它包含在其他文本中时。所以基本上它必须以它开始和结束......
I came here to Branglebracken with my wife and child, as well as an Altmer herbalist who wanted to explore the forest.\n\nCould you check on them? Since they're not back already, I assume they've taken a rest at the wayshrine to the northwest.
Branglebracken
Branglebracken
Branglebracken
[intentionally repeated]
输出是这样的
I came here to Branglebracken with my wife and child, as well as an Altmer herbalist who wanted to explore the forest.\n\nCould you check on them? Since they're not back already, I assume they've taken a rest at the wayshrine to the northwest.
word-replaced
word-replaced
word-replaced
[intentionally repeated]
如您所见,文本必须仍然包含“Branglebracken”一词
【问题讨论】: