How to use VIM replacement to use the hit part in the pattern string
给我你的怀抱
给我你的怀抱 2017-05-16 16:42:43
0
2
656

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
How should

be written?

给我你的怀抱
给我你的怀抱

reply all(2)
仅有的幸福

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\+\):FB:g
洪涛

:%s/A(d+)/F1B/g
You can use regular expressions after escaping

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!