随便一个界限符(delimiter)都可以的,不是字母和数字就行。
*pattern-delimiter* *E146*
Instead of the '/' which surrounds the pattern and replacement string, you
can use any other single-byte character, but not an alphanumeric character,
'\', '"' or '|'. This is useful if you want to include a '/' in the search
pattern or replacement string. Example: >
:s+/+//+
For the definition of a pattern, see |pattern|. In Visual block mode, use
|/\%V| in the pattern to have the substitute work in the block only.
Otherwise it works on whole lines anyway.
【 在 jman 的大作中提到: 】
: 标 题: Re: 怎么把\替换为/,真是发愁啊。
: 发信站: 水木社区 (Mon Aug 1 11:50:42 2016), 站内
:
: 定界符
: 一般用 /
: 如:
: s/a/b
: 然而这里替换串是 / , 使用 /定界的话, 需要用
:
: s/\\/\/
:
: 似乎没有 s#\\#/ 看起来舒服
:
: 不过, 我认为换其它定界符(# 只是其中之一) , 并无必要
:
: 用 \ 转义是让人心情愉快的一件事情......
:
:
:
: 【 在 S06212041 (东坡道人) 的大作中提到: 】
: : 标 题: Re: 怎么把\替换为/,真是发愁啊。
: : 发信站: 水木社区 (Mon Aug 1 11:20:13 2016), 站内
: :
: : 请问这里的#是啥意思?谢谢
: : 【 在 iNero 的大作中提到: 】
: : : %s#\\#/#gc
: :
: : --
: :
: : ※ 来源:·水木社区
http://www.newsmth.net·[FROM: 128.138.65.*]
:
:
: --
:
: ※ 来源:·水木社区 newsmth.net·[FROM: 113.143.181.*]
--
FROM 113.81.170.*