How do I search for 'bar' that is not preceded by 'foo'?
/foo\@<!bar
Vim regex supports zero-width assertions, so you can match text based on context without consuming the context itself.
/foo\@<!bar
Vim regex supports zero-width assertions, so you can match text based on context without consuming the context itself.
/\v(pattern)@<=match
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
search #search #regex #advanced-search #lookahead #lookbehind
/\(foo\)\@<=bar
Use \@<= for positive lookbehind.
/\(pattern\)\@<=target or /target\(pattern\)\@=
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.