I am mentally processing this differently.
Also In this case hindsight is perfect so I'll get the correct answer.
We are using RegEx so the entire string must match.
(\d*) means 0 or more of \d so I mentally process 0 as that is the rightmost judgement I can make. (\d+) means 1 or more of \d so I mentally process 1 as that is the rightmost judgement I can make.
In these two cases it is then easy to complete the match of the entire string.
All that remains left of the \d groups is (.*) .
So then, "G1: \1 G2: \2" becomes G1: abc123 G2: and G1: abc12 G2: 3 .
I'm sorry to disappoint you, but you can try as hard as you want, mentally, scriptally, opusally, whateveraly ... regexp are evaluated from left to right. They just are.
If you dig around, you'll even see people trying to find ways to have them go from right to left, but it's always workarounds.
I do not know of any regexp engine that evaluates from right to left ... because results would differ too much from what people are expecting.
If you need to, you can look again at lxp's post with abc123, and you can also take a look at some explanations on how regexps work (I find this one quite good), and you'll get information on greedy, lazy, backreferences, lookahead, lookbehind: they are all based on the fact that the expression is evaluated from left to right.