Parsing a search string

M.E.Farmer mefjr75 at hotmail.com
Sat Jan 1 03:11:25 CET 2005


py>b = shlex.shlex(a)
py>while 1:
...     tok = b.get_token()
...     if not tok: break
...     print tok
...
moo
cow
+
"farmer john"
-
dog

Just wanted to share this just in case it might be relevant .
It seems if we don't add +- to wordchars then we get a different split
on "farmer john".
M.E.Farmer




More information about the Python-list mailing list