The description of the problem is rather obscure, so I will give an example directly There is a file like this
A1 A2 A3
hopes to be replaced with
F1B1 F2B2 F3B3
be written?
vim’s regular expressions are quite special, see http://vimregex.com/, but it supports back references, but you need to use escaped brackets ( 和 ),然后在替换部分依序引用(如, 1).
(
)
1
:%s:A\(\d\+\):FB:g
:%s/A(d+)/F1B/g You can use regular expressions after escaping
vim’s regular expressions are quite special, see http://vimregex.com/, but it supports back references, but you need to use escaped brackets
(
和)
,然后在替换部分依序引用(如,1
).:%s/A(d+)/F1B/g
You can use regular expressions after escaping