Reputation: 4395
Content:
1. Text is here.
20. More text.
Why does this Vim search and replace string fail?
:%s/^\d+\.\s+/# /g
Upvotes: 0
Views: 328
Reputation: 116501
The +
must be escaped in Vim's version of regex. So use \+
.
Upvotes: 2
Reputation: 799520
Some metacharacters need to be escaped in order to take effect:
:%s/^\d\+\.\s\+/# /g
Upvotes: 6