Splitting a quoted string.

mosscliffe mcl.office at googlemail.com
Wed May 16 06:42:49 EDT 2007


I am looking for a simple split function to create a list of entries
from a string which contains quoted elements.  Like in 'google'
search.

eg  string = 'bob john "johnny cash" 234 june'

and I want to have a list of ['bob', 'john, 'johnny cash', '234',
'june']

I wondered about using the csv routines, but I thought I would ask the
experts first.

There maybe a simple function, but as yet I have not found it.

Thanks

Richard




More information about the Python-list mailing list