From: "David A. Black" Date: 2009-07-22T19:58:21+09:00 Subject: Re: String spliting and inclusion On Wed, 22 Jul 2009, 7stud -- wrote: > Robert Dober wrote: >> On 7/22/09, David A. Black wrote: >>>> strings no longer than 50 characters in length. At present I have the >>>> and only 20 characters remain it misses them off the output (it outputs >>>> >>> >>> Try this. I don't guarantee robustness. >>> >>> str.scan(/\b.{0,50}(?:$|\b)/m) >> I fail to see why you put a \b at the beginning David, >> would you mind to explain? >> > > Yes. Please explain that. Also please explain why you don't have > {1,50}? > > Or, will you claim the 5th under the robustness disclaimer? I won't claim anything. Feel free to experiment with the code, which I've already said repeatedly isn't a full solution, and see what you come up with. David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Now available: The Well-Grounded Rubyist (http://manning.com/black2) Training! Intro to Ruby, with Black & Kastner, September 14-17 (More info: http://rubyurl.com/vmzN)