How can I include the period (.) in Vim's search and replace command? (replacing .html extensions)?
When I do开发者_开发知识库: /.html
Vim looks for html
I would like to replace all the .html
with .php
Something like this: :%s/html ext/php ext/g
Escape it. The .
is a regex character which means "any character", so you need to escape it with \
.
:%s/\.html/.php/g
Just escape the .
character.
Search for /\.html
Try escaping period character: /\.html
Use backslach to escape the dot.
/\.html
will look for ".html".
精彩评论