http://qs321.pair.com?node_id=1231479


in reply to help with regex

split can also capture. So if you want all the pieces, the G-strings and the other bits, it could work like this

use strict; use warnings; my $line = "GGCTTTCCGTTGTTGCTGGGTGTGGGGGGCGGGCGAGATTGGAAGAGCACACGTCTGA +ACTCCAGTCACGCCAATATCTCGTATGCCGTCTTCTGCTTGAAAAAAGGGGTGGGGGGGAGGGGGGGCG +GGGGGGGGGGGGGGAGGGGGGGAG"; my @pieces = split /(G{10,})/, $line; print "$_\n" for @pieces;