How do you use a register value in a substitute command?
Answer
:%s/<C-r>a/replacement/g
Explanation
In command-line mode, <C-r>a inserts the contents of register a. Use it in substitute commands to search for previously yanked text.
:%s/<C-r>a/replacement/g
In command-line mode, <C-r>a inserts the contents of register a. Use it in substitute commands to search for previously yanked text.