newbie parsing question

Kun neurogasm at gmail.com
Fri Mar 24 20:44:25 EST 2006


raviteja.bhupatiraju at gmail.com wrote:
> Use Regular expressions
> http://docs.python.org/lib/module-re.html
> 
i tried to parse (below) with the regular expression: emails = 
re.findall('\S*\s(\w+@\w+\.\w+)', senders)

and got the following error:

Traceback (most recent call last):
   File "/Life/School/Homework/Spring 2006/OPIM 
399/Tutorial/IMAP/scannermailer.py", line 19, in -toplevel-
     emails = re.findall('\S*\s(\w+@\w+\.\w+)', senders)
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sre.py", 
line 167, in findall
     return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer


any help would be appreciated.








[('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Kevin Feng 
<fengk at wharton.upenn.edu>\r\n\r\n'), ')', ('461 (BODY[HEADER.FIELDS 
(FROM)] {37}', 'From: Kevin <neurogasm at gmail.com>\r\n\r\n'), ')']



More information about the Python-list mailing list