How can I replace text just before the EOL in vi?
I'm trying to do a search in replace in vi
. The usual:
:s/yes/no/gc
isn't cooperating. The "yes" is the last piece of text o开发者_如何学Cn the line. If I search for text isn't part of the last word the command works. But none of the following seem to be cooperating:
:s/ye/no/gc
:s/yesCTRLVCTRLM/noCTRLVCTRLM/gc
The file is a DOS formated (EOL) file.
Suggestions?
:s/yes$/no/gc Should do the trick
$ is the character representing the end of the line. ^ would represent the start of the line.
精彩评论