in reply to Re^2: \G and regexes
in thread \G and regexes

The /g flag does not require that further matching must start past the end of the previous match--it just makes a request for any other unique matches.

No. It makes a request for another match to the leftright of the end of the previous match. The first match goes up to position 12:

aaaBBBcccTGAddTGA XXXXXXXXX TGA ^ match ends here
So the next match sees only <c>ddTGA</cc> to match against.
Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^4: \G and regexes
by 7stud (Deacon) on Apr 06, 2010 at 04:03 UTC
    Do you mean to the 'right' of the end of the previous match?
      Yes. Corrected. Sorry for the confusion.