in reply to Re: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
in thread Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
I really like that Javascript version.
You either like or hate regexps for this kind of thing, but as regexp-based solutions go "ZBBBCZZ".match(/((.)\2*)/g) is damn concise.
I couldn't get the perl version to be that concise... pity.
I hope perl6's Rules allow one to specify a sub-match that can be referenced and then thrown away.
-David
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
by TimToady (Parson) on Sep 12, 2007 at 16:58 UTC | |
Re^3: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...) (js)
by tye (Sage) on Sep 12, 2007 at 17:45 UTC | |
by erroneousBollock (Curate) on Sep 13, 2007 at 14:47 UTC | |
by tye (Sage) on Sep 14, 2007 at 06:36 UTC | |
by pKai (Priest) on Sep 22, 2007 at 10:54 UTC |
In Section
Meditations