I simply don\'t understand what the \\G
anchor does.
If I execute /\\G\\d\\d/
on 1122aa33
, it will match 11
and
According to this:
The anchor \G matches at the position where the previous match ended. During the first match attempt, \G matches at the start of the string in the way \A does.
Now, to actually answer your question: In your second example, the one that yields no results, \G can't match the start of the string, because you're seeking two digits first, and, without that initial match, \G won't match anything else, either.