I am trying to construct a regex pattern to match characters inside two #
characters. For example:
#abc#bc#cd#
I would like to match abc
, bc
and cd
. The following regex without using magic mode works as expected:
\(#\)\@<=.\{-\}\(#\)\@=
But when I try to use the very magic
mode, I can not make the regex pattern right. Here is what I have come up with:
\v(#)\@<=.{-}(#)\@=
and it does not work (matches nothing). Can you point out what is wrong with my regex pattern?
:h /\v
#
has special meaning? I can not find the doc on this.\v(#)@<=.{-}(#)@=
default magic mode
? I use very magic mode because it is more like Perl regex syntax.:h /\v