【发布时间】:2013-07-08 09:11:25
【问题描述】:
我有一个包含方括号内的文本的文档,例如:
The fish [ate] the bird.
[This is some] text.
Here is a number [1001] and another [1201].
我需要删除方括号和括号内的所有信息,例如:
The fish the bird.
text.
Here is a number and another .
- 我试过
sed -r 's/\[[+]\]//g' file.txt,但没有成功。
如何删除模式[<anything>] 中的任何内容?
【问题讨论】: