Find expression A where expression B follows
\@=
e.g. \A\(B\)\@=
might be easier to use \ze
Find expression A where expression B does not follow
\@!
e.g. A\(B\)\@!
Find expression A where expression B is behind:
\@<=
e.g. \(B\)\@<=A
might be easier to use \zs
Find expression A where expression B is not behind:
\@<!
e.g. \(B\)\@<!A
For example
foo(
def foo(
to match only function definitions, e.g. the foo
after
def
\(def[ ]\)\@<=foo(
to match function usage e.g. the foo
not after
def
\(def[ ]\)\@<!foo(
foobar
foobaz
foo\(bar\)\@=
- matches foo that follows with bar
e.g. matches first
foo\(bar\)\@!
- matches foo that not follows with bar
e.g. matches second