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;
In reply to Re: help with regex
by hdb
in thread help with regex
by rnaeye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |