From: dblack@... Date: 2003-08-21T20:23:56+09:00 Subject: Re: Regular expression question Hi -- On Thu, 21 Aug 2003, Harry Ohlsen wrote: > I'm sure this is trivial, but I don't have my Mastering Regular Expressions handy (and I haven't put sufficient effort into getting through it!). > > I have a string that looks something like ... > > >>"Guido van Rossum", "Larry Wall", "Matz"<< > > (ie, it's the set of quoted strings between the markers). What I'd like to do is split the string up into an array containing the three quoted items (with or without the quote marks). Something like this (tweaked as needed) should work: irb(main):006:0> str => "\"Guido van Rossum\", \"Larry Wall\", \"Matz\"" irb(main):007:0> str.scan(/".+?"/) => ["\"Guido van Rossum\"", "\"Larry Wall\"", "\"Matz\""] David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav