in reply to 'grouping' substrings?
On the off chance that you actually meant 6 or more M's, try this modification of japhy's solution:
(where the displayed positions are 0-based.)my $seq = "..."; my @groups; push @groups, [$-[0], $+[0]-1] while $seq =~ /M{6,}/g; print "$_->[0] to $_->[1]\n" for @groups;
|
|---|