XP is just a number | |
PerlMonks |
Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)by erroneousBollock (Curate) |
on Sep 12, 2007 at 06:13 UTC ( [id://638488]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Meditations
|
|