f=->(s){s.chars.chunk{|c|c.to_i.to_s==c}.select{|e|e[0]}.transpose[1]} p f.call("z526ks4f.;8]\p")
Standard input is empty
[["5", "2", "6"], ["4"], ["8"]]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!