good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
by erroneousBollock
|
|