Is there a way to do negative lookahead in vim regex?

后端 未结 5 1732
一生所求
一生所求 2021-01-31 15:40

In Vim, is there a way to search for lines that match say abc but do not also contain xyz later on the line? So the following lines would match:

<
5条回答
  •  春和景丽
    2021-01-31 16:11

    Although your question is about lookahead, I found it while searching for lookbehind. Thus, I post the solution to lookbehind so that others may find it.

    If you search for pattern2 not preceded by pattern1, that is negative lookbehind, search for:

    \(pattern1\)\@

提交回复
热议问题