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

Re^2: Split a string based on change of character

by Skeeve (Vicar)
on Jul 28, 2007 at 13:16 UTC ( #629290=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $string= 'AAABBBCCCDD';
    my $i=0;
    my @words= grep $i=!$i,split /(?<=(.))(?!\1)/,$string;
    print join "\n",@words,'';
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2018-11-15 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (186 votes). Check out past polls.

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