The expression below captures the first group match and adds its to a list for later use.
let t =[] | '<,'>s/\v\\code\{([^}]+)}\zs/\=add(t, submatch(1))[1:0]/g
We can then place the list into another section of the file with.
put = t
The expression below captures the first group match and adds its to a list for later use.
let t =[] | '<,'>s/\v\\code\{([^}]+)}\zs/\=add(t, submatch(1))[1:0]/g
We can then place the list into another section of the file with.
put = t