I like to use \ze
in these cases
:%s/\<pointer->.*()\ze, /&.value()/
\ze
marks the end of the match&
is equivalent to\0
- remove the
\>
as I feel like this is an accident. See:h /\>
- May want to use an non-greedy qualifier like
\{-}
instead of*
, better yet maybe[^(]*
- May want to use
\zs
to the mark start of the match and eliminate the need for&
. See @Pak's comment below
For more help see:
:h /\ze
:h s/\&
:h /\>
:h /\{-