I don't understand why the two REs produce a different result. I read 
the RE guide but still I can't seem to figure it out.

 >>> t
'echo user=name password=pass path="/ret files"\r\n'
 >>> re.findall(r'(?<=\s)[^=]+=((?:".*")|(?:\S*))(?=\s)', t)
['name', 'pass', '"/ret files"']
 >>> re.findall(r'(?<=\s)[^=]+=((".*")|(\S*))(?=\s)', t)
[('name', '', 'name'), ('pass', '', 'pass'), ('"/ret files"', '"/ret 
files"', '')]


Also, does '|' char (meaning or) produces a pair for each section. I 
don't understand how it works. Can someone please direct me to a place 
which will explain it?

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to