Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Elegant way to split into sequences of identical chars?

by xdg (Monsignor)
on Nov 30, 2005 at 12:08 UTC ( #512913=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $re = qr/(.)\1*/;
    
    ...
    
    @matches = $string =~ m/((??{$re}))/g;
    print "@matches\n"; # xx 55 6 xx
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2019-11-22 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (107 votes). Check out past polls.

    Notices?