vim yank all matches of regex group into register
You can do this with a substitute command.
:%s/regex/\=setreg('A', submatch(0))/n
This will append register a to whatever the regex matched. The n
flag will run the command in a sandbox so nothing will actually get replaced but the side effects of the statement will happen.
You probably want to empty the register first with
:let @a=''