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

后端 未结 5 1724
一生所求
一生所求 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 15:58

    I always find it weird, that you need to escape brackets in vim, so I try to use the "very magic" mode most of the time, activated with \v:

    /\vabc(.*xyz)@!
    

提交回复
热议问题