Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2019-05-22 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (140 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!