如何删除以 [ 开头并以 ] 结尾的多个单词
How to remove multiple words start with [ and end with ]
我有一个文件subdomains.txt。我想从文件数据中删除一些单词。
[Sublist3rAPI] andrei2.markelow.example.com
[Sublist3rAPI] tema-x.example.com
[ThreatCrowd] fireeye-testevent.example.com
[ThreatCrowd] certs.example.com
[Google] swat.example.com
[Google] apps.example.com
到
andrei2.markelow.example.com
tema-x.example.com
fireeye-testevent.example.com
certs.example.com
swat.example.com
apps.example.com
使用命令模式“正常”
:%norm dW
它应用普通命令dW
,删除整个文件的“big word”%
。
或者我们可以通过awk过滤当前文件
:%!awk '{print }'
我会用
:%s/^\[\w\+]\s*/
或
:%s/^\[[^]]\+]\s*/
我有一个文件subdomains.txt。我想从文件数据中删除一些单词。
[Sublist3rAPI] andrei2.markelow.example.com
[Sublist3rAPI] tema-x.example.com
[ThreatCrowd] fireeye-testevent.example.com
[ThreatCrowd] certs.example.com
[Google] swat.example.com
[Google] apps.example.com
到
andrei2.markelow.example.com
tema-x.example.com
fireeye-testevent.example.com
certs.example.com
swat.example.com
apps.example.com
使用命令模式“正常”
:%norm dW
它应用普通命令dW
,删除整个文件的“big word”%
。
或者我们可以通过awk过滤当前文件
:%!awk '{print }'
我会用
:%s/^\[\w\+]\s*/
或
:%s/^\[[^]]\+]\s*/