Vim 正视匹配模式

Vim positive look behind match pattern

代码如下:

return (

    <div></div>
)

注意<div></div>上面有一个空行。

我想在 <div> 中匹配 <。这是我尝试过的:

所以,我的问题是:

What's the difference between \@<= and \zs?

  1. lookbehind 运算符\@<= 不能搜索早于上一行
  2. \zs\ze 允许您显式定义匹配

参见 :help \@<=:help \zs

How to use \@<= to match the < without remove the blank line above?

你不能。出于性能原因,lookbehind 不会在匹配前查看 2 行