Say I have lines like this:
'alpha' 123
'beta' 678
'alpha' 998
'gamma' 212
And using the search and replace regular expression in VIM, include it in the following:
'alpha' 123 : alpha
'beta' 678 : beta
'alpha' 998 : alpha
'gamma' 212 : gamma
Basically, a search will not replace what it is looking for, but instead just uses it for something else. In my head, this should work:
:g/'\(.*\)'/s/$/: \1/g
But this was not done. How do I not consume what I am looking for, but save it for use?
source
share