开发者

In Vim, how do I match on "=" but not on "=="?

I've tried a number of different search patter开发者_如何学Pythonns:

  • [^=]=[^=] works but only if = is not at the beginning/end and it also matches the sandwiching characters
  • =\@!==\@! seems like it should work because \@! matches nothing but requires a match, but it doesn't (see :help pattern-overview)
  • [^=]\@==[^=]\@= also doesn't but seems like it should

Suggestions?


Ah hah: =\@<!==\@!


How about

[^=]\?\zs=\ze[^=]\?

\zs starts the match \ze ends the match

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜