From: email55555@... Date: 2005-09-15T06:16:34+09:00 Subject: Re: Quick and dirty word wrapping. The origin post assumes no word longer then wrap size. So if you like the wrap size less than word length, you have to change a little bit regexp. Here is my change to make sure no lost char ... str = 'This is a test of the emergency broadcasting services' p str.scan(/(.{1,10}|\S{11,})(?:\s+|$)/) # for wrap size == 10 # => [["This is a"], ["test of"], ["the"], ["emergency"], ["broadcasting"], ["services"]] p str.scan(/(.{1,5}|\S{6,})(?:\s+|$)/) # for wrap size == 5 # => [["This"], ["is a"], ["test"], ["of"], ["the"], ["emergency"], ["broadcasting"], ["services"]]