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 \+
.
精彩评论