2021年4月27日星期二

Why doesn't vim accept + in `substitute()`?

:echo substitute("15", "15\?", "replaced", "")  15  

:help substitute() reports that we are cpoptions is empty and we're using magic and some other small differences (that don't seem to point to \? not working).

A file with the following:

15  

followed by

:%s/\m15\?/replaced/  

will indeed replace the 15 with replaced.

Can anybody point out to me the divergence here and where the manual explains this?

https://stackoverflow.com/questions/67293264/why-doesnt-vim-accept-in-substitute April 28, 2021 at 11:17AM

没有评论:

发表评论