On Mon, 13 Mar 2006 17:23:56 +0900, Ross Bamford <rossrt / roscopeco.co.uk>
wrote:
[snip]
> Maybe something like:
> 
> 	s.scan(/(\d)(\1*)/).map! { |e| e.join }
> 	# => ["111", "22", "3", "1", "33"]
> 
> or:
> 
> 	s.scan(/0+|1+|2+|3+|4+|5+|6+|7+|8+|9+/)
> 	# => ["111", "22", "3", "1", "33"]

Or:

  s.scan(/((.)\2*)/).transpose[0]

Boy, are my fingers glad to save those keystrokes :-)

andrew

-- 
Andrew L. Johnson   http://www.siaris.net/
      They're not soaking, they're rusting!
          -- my wife (on my dishwashing habits)