Help for this page
x = [] "ZBBBCZZ".scan(/((.)\2*)/){ x << [$~[0]]; x.flatten!}
# => [["Z"], ["BBB"], ["C"], ["ZZ"]]