If you want all the Gs (15 for the sample data given), you need to make the first match non-greedy: / .*? G{10,} /x.
Or just / G{10,} /x would be simpler and do the same thing. (Unless the string contains newlines!)
In reply to Re^2: help with regex
by jwkrahn
in thread help with regex
by rnaeye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |