Find Search Items in vim [Possible VIM Error]

I wanted to understand the behavior of the return path in vim, so I tried to mark the position of the statement. Suppose I have the contents of this file:

Foobar

Running this command :s/\(foo\)\@<!/♠ /g, I got:

♠ f ♠ o ♠ ob ♠ a ♠ r

Why don't I have at the end of the line? Is the anchor not considered a position in this case? $

Instead, if I execute this command :%s/\(bar\)\@<=/♠ /g, I got:

Foobar ♠

Any explanation? and can anyone confirm this behavior?


Vim 7.4 Ubuntu 16.04 LTS

+4
source share
1 answer

.

:s/\(foo\)\@<!/♠ /g :s/\zs/♠ /g

♠ f♠ o♠ o♠ b♠ a♠ r

; ( Vim).


:%s/\(bar\)\@<=/♠ /g $ . , :s/$/♠ /g, , () .


, , , , , Vim . , . , vim_dev.

+1

Source: https://habr.com/ru/post/1664814/


All Articles