I don’t think such replacements is supported. You can see the source here. It explicitly matches an integer after \\g{.
\\g{