我有一个文档,在方括号内包含一些文本,例如:
The fish [ate] the bird.
[This is some] text.
Here is a number [1001] and another [1201].
Run Code Online (Sandbox Code Playgroud)
我需要删除方括号和方括号内的所有信息,例如:
The fish the bird.
text.
Here is a number and another .
Run Code Online (Sandbox Code Playgroud)
sed -r 's/\[[+]\]//g' file.txt,但这没用.如何删除模式中的任何内容[<anything>]?