This is a multi-part message in MIME format.

--Boundary_(ID_Mbeub26IwuRohfGF9tGirw)
Content-type: text/plain; charset=us-ascii; format=flowed
Content-transfer-encoding: 7BIT

Xavier Noria wrote:

>On Thursday 21 August 2003 13:23, dblack / superlink.net wrote:
>
>  
>
>>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\""]
>>    
>>
>
>Harry asked for support for \"s inside strings as well. For that a bit 
>more of work is needed:
>
>    test  >>"Guido", "Larry", "Matz", "foo \"bar\""<<'
>    puts test.scan(/"(?:\\.|[^"\\])*"/)
>
>gives
>
>    "Guido"
>    "Larry"
>    "Matz"
>    "foo \"bar\""
>
>  
>
Thanks to both of you.  I like that a lot better than the long one from 
MRE that Mike posted, but I guess I'll have to try some complex cases to 
see that it works 100%.

Cheers,

Harry O.



--Boundary_(ID_Mbeub26IwuRohfGF9tGirw)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: 7BIT

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv
ontent-Type" contentext/html;charsetO-8859-1"> <title></title> </head> <body text000000" bgcolorffffff"> Xavier Noria wrote:<br> <blockquote type
ite" citeid200308211858.19963.fxn / hashref.com"> <pre wrap>On Thursday 21 August 2003 13:23, <a classoz-txt-link-abbreviated" hrefailto:dblack / superlink.net">dblack / superlink.net</a> wrote: </pre> <blockquote type
ite"> <pre wrap>Something like this (tweaked as needed) should work: irb(main):006:0&gt; str t; "\"Guido van Rossum\", \"Larry Wall\", \"Matz\"" irb(main):007:0&gt; str.scan(/".+?"/) t; ["\"Guido van Rossum\"", "\"Larry Wall\"", "\"Matz\""] </pre> </blockquote> <pre wrap><!----> Harry asked for support for \"s inside strings as well. For that a bit more of work is needed: test &gt;&gt;"Guido", "Larry", "Matz", "foo \"bar\""&lt;&lt;' puts test.scan(/"(?:\\.|[^"\\])*"/) gives "Guido" "Larry" "Matz" "foo \"bar\"" </pre> </blockquote> Thanks to both of you.&nbsp; I like that a lot better than the long one from MRE that Mike posted, but I guess I'll have to try some complex cases to see that it works 100%.<br> <br> Cheers,<br> <br> Harry O.<br> <br> <br> </body> </html> --Boundary_(ID_Mbeub26IwuRohfGF9tGirw)--