Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

by moritz (Cardinal)
on Aug 12, 2007 at 08:00 UTC ( #632029=note: print w/replies, xml ) Need Help??

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

Allow me to add my favorite Perl 6 solutions. The split version is not tested yet because Pugs::Compiler::Rule doesn't seem to implement <before> and <after>:

my $s = "ZBBBCZZ"; my @list = $s.comb: rx/(.)$0*/; # or if you are very fond on split: my @list = $s.split(rx/<after (.)><!before $0>/);

The comb-Version seems to be the same as the ruby example, the split-Version shows off the new regex syntax ;-)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2019-04-19 03:15 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (106 votes). Check out past polls.

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