From: Lex Williams Date: 2008-09-25T23:43:56+09:00 Subject: Re: how to wrap a long string Considering that : a = "1112223334444" watch the following irb session : irb(main):010:0> a.scan(/((.)\2+)/).collect {|match| match[0]} => ["111", "222", "333", "4444"] using that regex , you'll obtain an array of matches . -- Posted via http://www.ruby-forum.com/.