Richard Livsey <richard / livsey.org> writes: > I want to split a string into words, but group quoted words together > such that... > > some words "some quoted text" some more words > > would get split up into: > > ["some", "words", "some quoted text", "some", "more", "words"] How about the csv module? Despite the name, you don't have to use commas. require 'csv' CSV::parse_line('some words "some quoted text" some more words', ' ') I hope this helps, Tim