From: Erik Veenstra Date: 2008-09-26T07:43:57+09:00 Subject: Re: how to wrap a long string You'll miss the unrepeated characters: > ruby -e 'p "abbcccdddd".scan(/((.)\2+)/).transpose.shift' ["bb", "ccc", "dddd"] Where did "a" go? Change the "+" into "*" and it'll work: > ruby -e 'p "abbcccdddd".scan(/((.)\2*)/).transpose.shift' ["a", "bb", "ccc", "dddd"] gegroet, Erik V. - http://www.erikveen.dds.nl/