Re: split a string with quoted parts into list

2005-03-10 Thread Paul McGuire
Oliver - Here is a simpler approach, hopefully more readable, using pyparsing (at http://pyparsing.sourceforge.net). I also added another test word to your sample input line, one consisting of a lone pair of double quotes, signifying an empty string. (Be sure to remove leading '.'s from Python t

Re: split a string with quoted parts into list

2005-03-10 Thread Scott David Daniels
oliver wrote: i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\Ha

Re: split a string with quoted parts into list

2005-03-10 Thread Max M
oliver wrote: hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with

Re: split a string with quoted parts into list

2005-03-10 Thread Diez B. Roggisch
> is there another way to convert a string with quoted sub entries into a > list of strings? try the csv-module. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: split a string with quoted parts into list

2005-03-10 Thread Daniel Dittmar
oliver wrote: i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\Ha

split a string with quoted parts into list

2005-03-10 Thread oliver
hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\HasNo