On 2009-03-26, R. David Murray <rdmur...@bitdance.com> wrote:
> Tim Chase <python.l...@tim.thechases.com> wrote:
>>    r = re.compile(r"""
>>      (\w+)
>>      \s*=\s*(
>>      "(?:[^"]*)"
>>      |
>>      [^,]+
>>      )
>>      """, re.VERBOSE)
>>    results = [
>>      (m.group(1), m.group(2).strip('"'))
>>      for m in r.finditer(s)
>>      ]
>> 
>> Things like internal quoting ('b="123\"456", c="123""456"') would 
>> require a slightly smarter parser.
>
> Thank you thank you.

We'll wait until you need to modify that and then ask if you're
still grateful.  ;)

"There once was a programmer who had a problem..."

-- 
Grant Edwards                   grante             Yow! I'm a fuschia bowling
                                  at               ball somewhere in Brittany
                               visi.com            
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to