开发者

Vim: Searching and Replace regex fails

Content:

1.                  Text is here.
20.                 More text.

Why d开发者_C百科oes this Vim search and replace string fail?

:%s/^\d+\.\s+/# /g


Some metacharacters need to be escaped in order to take effect:

:%s/^\d\+\.\s\+/# /g


The + must be escaped in Vim's version of regex. So use \+.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜