Say I have lines like this:
'alpha' 123
'beta' 678
'alpha' 998
'gamma' 212
And using the search & replace regex in VIM, turn it into this:
'alpha' 123 : alpha
'beta' 678 : beta
'alpha' 998 : alpha
'gamma' 212 : gamma
Basically, the search won't be replacing what it's searching for, but instead just using it for something else. In my head, this should work:
:g/'\(.*\)'/s/$/: \1/g
But that didn't do it. How do I not consume what I'm searching for but retain it for use?