Andrew Savige wrote:
>   s = "ZBBBCZZ"
>   x = s.scan(/((.)\2*)/).map {|i| i[0]}

Maybe this ist faster:

result = []
"ZBBBCZZ".scan(/((.)\2*)/){erg.push [$~[0]]}
p erg # => [["Z"], ["BBB"], ["C"], ["ZZ"]]

Wolfgang NĂ¡dasi-Donner
-- 
Posted via http://www.ruby-forum.com/.