From: "David A. Black" Date: 2004-07-14T21:44:07+09:00 Subject: Re: Split quoted text Hi -- On Wed, 14 Jul 2004, Michael Weller wrote: > Hi! > Can anybody help me with following, it seems like I can find a solution > that's shorter than 50LOC and I thought there must be a smarter way to > do it... > My input would be something like "\this is\" \"my text\"" and I want to > have an array containing ["\"this is\"", "\"my text\""]. > I know it can't be that hard, but ... p '"this is" "my text"'.scan(/"[^"]+"/) # => ["\"this is\"", "\"my text\""] David -- David A. Black dblack@wobblini.net