As I see the substitution command e.g.:
:% s/a/b/
puts a into the register "/ but the text that is being replaced is not saved in a register. Now, I would like to replace a with b but keep the result of a in a specific register where I can any moment retrieve it and paste it back at the same position where it was. I mean something like this:
Replace the text:
:% s/^\(.*\)\t\(.*\)/\2/g
Retrieve it from register "z and paste it back where it was:
:% s/^/\=@z/g
I think it should be pretty simple but I couldn't find anything related.
^<original matched pattern>\2
?