Is it possible to use find and replace on a wildcard string in VIM?

I believe you want

:%s/foo\(\w\+\)Bar/& = \1 + \1\Old/

explanation:

\w\+ finds one or more occurences of a character. The preceeding foo and following Bar ensure that these matched characters are just between a foo and a Bar.

\(...\) stores this characters so that they can be used in the replace part of the substitution.

& copies what was matched

\1 is the string captured in the \(....\) part.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)