I found a solution:
M-s o for occur-mode, search for g1
C-x o to change to the other window
e to enable editing
Edit by rectangle tagging or similar
C-c C-c to switch back to occur-mode
However, I am still interested in a better or more elegant solution.
The key to use is C-S-RET, not S-RET. That's Control with Shift and Return.
And you do want to replace the whole context, if your context is text. So option icicle-search-replace-whole-candidate-flag should be non-nil.
I think that answers your question, but here is some more info, in case it helps.
There are of course other ways to perform the simple ...