Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Split a string based on change of character

by moritz (Cardinal)
on Jul 28, 2007 at 08:04 UTC ( #629265=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -MData::Dumper -wle '$Data::Dumper::Indent=0; $_="aaabbc"; prin
    +t Dumper([split m/(?<=(.))(?!\1)/]);'
    $VAR1 = ['aaa','a','bb','b','c','c'];
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2015-01-29 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (244 votes), past polls