开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜