The description of the problem is rather obscure. I will give a direct example.
There is a file like this
A1 A2 A3
Hope to be replaced by
F1B1 F2B2 F3B3
How should it be written?
Vim’s regular expression is quite special, seehttp://vimregex.com/However, backward references are supported, but escaped brackets are required.
\), and then in the replacement part in order to reference (such as,
\1) is ok.:%s:A\(\d\+\):F\1B\1:g