Parsing a search string

M.E.Farmer mefjr75 at hotmail.com
Fri Dec 31 21:11:25 EST 2004


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