Parsing parameters with quotes

Giovanni Bajo noway at sorry.com
Fri Mar 14 22:13:14 CET 2003


"Sean Ross" <sross at connectmail.carleton.ca> ha scritto nel messaggio
news:Stbca.910$qc4.102056 at news20.bellglobal.com...

> Unfortunately, "this is one" still has quotes. so you can do
>
> >>> seq = p.findall(s)
> >>> q = re.compile(r'"')
> >>> seq = [q.sub('', word) for word in seq]
> >>> seq
> ['foo', 'this is one', 'and, 'this', 'not']

Well, string.strip() is easier here I believe. Anyway, thanks for the help.

Giovanni Bajo






More information about the Python-list mailing list