Vim regex - quantifier -
i have problem following expression in vim.
in text: aekwoeuwioeuwioeuwb_aewieuiwuiweub-a32r3r3hruh3u2hub a32r3r3hruh3u2hub select a-b strings separately. achievable a.*?b in standard regex. not able in vim.
the syntax non-greedy "zero or more" match a.*?b in vim a.\{-}b. see :help /\{-.
an overview of main differences perl's regular expression dialect can found @ :help perl-patterns.
alternative
for simple patterns, end delimiter can excluded range, default greedy matching work, too: a[^b]*b
Comments
Post a Comment