I did the following tests:
code | output | notes |
---|---|---|
:echo substitute("s s", '\v[^s]', "<&>", "g") |
s< >s |
space replaced. All fine |
:echo substitute("s s", '\v[^\s]', "<&>", "g") |
s< >s |
[^\s] is the same as [^s] ! ?? |
:echo substitute("s s", '\v[^ \t]', "<&>", "g") |
<s> <s> |
both s replaced |
It looks like \s
does not work inside [ ]
brackets in Vim regular expression.
Is this expected?
Is there any way I can use \s \S
inside bracket expressions in Vim?