On Sep 14, 2005, at 8:26 AM, Erik Terpstra wrote:
> str = 'This is a test of the emergency broadcasting services'
> str.scan(/(.{1,30})(?:\s+|$)/)
>
> => [["This is a test of the"], ["emergency broadcasting"],  
> ["services"]]

Nice. Not to golf, but how about simply:

str = 'This is a test of the emergency broadcasting services'
p str.scan(/.{1,30}\b/)
#=> ["This is a test of the ", "emergency broadcasting ", "services"]

(No flattening required.)
--
(-, /\ \/ / /\/