我被更换<B>,并</B>用<STRONG>和</STRONG>在文件中。这有点像替换 hmtl 标签。我用过sed 's/\<B\>/STRONG/g'。它完成了这项工作,但如果在文件中[B]并且[/B]存在。然后它们也被更改为[STRONG]和[/STRONG]。我不明白它背后的逻辑。
<B>
</B>
<STRONG>
</STRONG>
sed 's/\<B\>/STRONG/g'
[B]
[/B]
[STRONG]
[/STRONG]
command-line text-processing
如何使用sed和定位长度超过 100 且小于 150 个字符的行grep
sed
grep
grep sed
command-line ×1
grep ×1
sed ×1
text-processing ×1