From: Harry Kakueki Date: 2009-07-23T18:13:17+09:00 Subject: Re: String spliting and inclusion >> >>  In Ruby 1.9 (or Oniguruma that is) the negative lookahead assertion >>  might lead to the most elegant solution: >> >>    /.{,50}(?!\B)/ > Nahh that leaves us with spaces at the beginning of the line > > p str.scan(/\s*(.{1,50})(?!\S)/) Or, if there are consecutive spaces between words, squeeze them out first. p str.squeeze(" ").scan(/\s*(.{1,50})(?!\S)/) Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/ruby/list.html