« Back to Index

[Vim Regex]

View original Gist on GitHub

Tags: #vim #regex #lookaround #assertions

Vim Regex.md

A zero-width negative lookaround assertion looks like:

level='(?!info)

Note: this would match level='error' or level='debug'.

The equivalent in Vim is:

/level='\(info\)\@!

Note: this strange syntax is documented here, see :h \@!

https://vim.fandom.com/wiki/Regex_lookahead_and_lookbehind