Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我使用 VIM 时,我遇到了一个简单的问题:
",\s\d\t))用替换模式",\s\d))。
",\s\d\t))
",\s\d))
例如:
更改以下内容
...roid", 1 )); ...id", 0 )); ...lite", 1 )); ...
至
...roid", 1)); ...id", 0)); ...lite", 1)); ...
我试过%s/",\s\d\t/",\s\d))/gc了,但它把它们改成了...roid",sd));
%s/",\s\d\t/",\s\d))/gc
...roid",sd));
使用反向引用。
%s/",(\s\d)\t/",\1))/gc
这里,(\s\d)是一个捕获组。\1指的是捕获组。
(\s\d)
\1