Content:
1. Text is here.
20. More text.
Why does this Vim search and replace string fail?
:%s/^\d+\.\s+/# /g
Content:
1. Text is here.
20. More text.
Why does 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 \+
.