Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

by Kjetil_Skotheim (Initiate)
on Oct 03, 2008 at 20:34 UTC ( #715274=note: print w/replies, xml ) Need Help??


in reply to Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

Shorter Perl 5 variants: Destroys $s: $s="ZBBBCZZ"; $s=~s/((.)\2*)/push@x,$1/eg; Nondestructive: $s="ZBBBCZZ"; $s=~s/((.)\2*)/push@x,$1;$1/eg; Needs a counter $i: $s="ZBBBCZZ"; @x=grep++$i%2,$s=~/((.)\2*)/g;
  • Comment on Re: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://715274]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-12-03 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (52 votes). Check out past polls.