Home
Sign Up
Sign In
V2EX
›
Vim
Vim中怎样把不能与指定正则表达式匹配的行都删掉?
013231
·
Jan 13, 2012
· 5943 views
This topic created in 5410 days ago, the information mentioned may be changed or developed.
对于文件的每一行, 如果可以和指定正则表达式匹配就保留, 否则就删除. 也就是说相当于grep过滤的效果. 在Vim中应该怎么做呢?
vim
正则表达式
匹配
2 replies
•
1970-01-01 08:00:00 +08:00
Vim
Jan 13, 2012
1
:v/pattern/d
或者
:g!/pattern/d
mybeky
Jan 13, 2012
2
:v/PATTERN/d
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
4693 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 00:13
·
PVG 08:13
·
LAX 16:13
·
JFK 19:13
♥ Do have faith in what you're doing.
❯