From: Xavier Noria Date: 2007-03-16T23:27:13+09:00 Subject: Re: Splitting A String On Mar 16, 2007, at 3:21 PM, Xavier Noria wrote: > puts str.scan(/"((?:\\.|[^"])*)"|(\w+)/).flatten.compact Sorry, that regexp was part of a test and got copied by accident. I just meant to clean up the select, that's: str = 'a quick "brown fox" jumped "over the lazy" dog' puts str.scan(/"([^"]*)"|(\w+)/).flatten.compact -- fxn