From: Bill Kelly Date: 2008-09-20T21:26:09+09:00 Subject: Re: [QUIZ] One-Liners Mashup (#177 again) From: "Bill Kelly" > From: "Sebastian Hungerecker" > >> Or if you want to avoid breaking in the middle of words: >> text.gsub(/(.{1,80})\s+/, "\\1\n") >> (you'll have lines above 80 chars if there's a single word with >> more than 80 characters). > > Indeed, I recall this from a previous ruby-talk thread... Oops - My apologies -- I found the post: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/287353 ... and the solution therein appears to have the same single-word breaking restrictions as Sebastion mentioned above. Regards, Bill