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.
category: search tags: #search #regex #lookbehind #patterns
![]() |
VOOZH | about |
/foo\@<!bar
Vim regex supports zero-width assertions, so you can match text based on context without consuming the context itself.
category: search tags: #search #regex #lookbehind #patterns
/\v(pattern)@<=match
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
category: search tags: #search #regex #advanced-search #lookahead #lookbehind
/\(foo\)\@<=bar
Use \@<= for positive lookbehind.
category: search tags: #search #lookbehind #regex
/\(pattern\)\@<=target or /target\(pattern\)\@=
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
category: search tags: #search #regex #lookahead #lookbehind #advanced