in reply to \G and regexes

The lack of any sort of anchor in the original pattern allows for any number of characters to occur before the pattern, so you are not guaranteed to fall on a codon boundary.

 XTGAXX would be a valid match for /(\w\w\w)*?TGA/ The simple solution is to anchor that pattern to the start of the string:

/^(\w\w\w)*?TGA/g
The down side is the potential to be very slow depending on how the regex engine handles the global match.

\G forces the next match to start after the previous one, preventing any expensive backtracking.

--Greg