Q:

Purpose of the \G anchor in regular expressions

I simply don't understand what the \G anchor does.
If I execute /\G\d\d/ on 1122aa33, it will match 11 and 22. However, when I try /\d\d\G/ on 1122aa33, it matches nothing.
Can someone enlighten me?

A:

\G is an anchor which matches the previous match position.
On the first pass, \G is equivalent to \A, which is the start of the string anchor. Since \d\d\A will never match anything (because how can you have two digits before the start of the string?), \d\d\G will also never match anything. 

