\zs
, ze
, modify the start or end of regex
match, can make replacing or searching easier
\zs
can replace positive look
behind@<=
\ze
can replace positive look ahead
@=
\_.
matches all characters and end of
line, useful for multiline matching
.
matches all characters but not end of line\w
matches word characters, same as
[0-9A-Za-z_]
\s
matches space or tab\{-}
non-greedy match, match as little as possible,
this is a multi
*
Intresting Examples
\(def\s\)\@<!foo_function(\_.\{-})
matches function
usage and params single line or multi lines, but not
the function definitiondef\s\w*(\zs\_.\{-}\ze)
matches only params in function
definitions, single line or multi linesa
an ordinary character,
\i
a character class, \(foo\)
putting
pattern in parenthesis making it an atom*
, \{n,m}
,
{-}
\@=
,
\@!
, look behind
\@<=
,\@<!
,a*b*
\&
concat, \&
means matching both regex
patterns, like AND\|
branch, \|
means either patterns, like
OR