Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: 'grouping' substrings?

by ysth (Canon)
on Feb 02, 2006 at 00:30 UTC ( [id://527200]=note: print w/replies, xml ) Need Help??


in reply to 'grouping' substrings?

Others seem to have interpreted this as "find all groups of one or more M's".

On the off chance that you actually meant 6 or more M's, try this modification of japhy's solution:

my $seq = "..."; my @groups; push @groups, [$-[0], $+[0]-1] while $seq =~ /M{6,}/g; print "$_->[0] to $_->[1]\n" for @groups;
(where the displayed positions are 0-based.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://527200]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-25 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found