newbie parsing question

Kun neurogasm at
Sat Mar 25 02:44:25 CET 2006

raviteja.bhupatiraju at wrote:
> Use Regular expressions
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/", line 19, in -toplevel-
     emails = re.findall('\S*\s(\w+@\w+\.\w+)', senders)
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>\r\n\r\n'), ')', ('461 (BODY[HEADER.FIELDS 
(FROM)] {37}', 'From: Kevin <neurogasm at>\r\n\r\n'), ')']

More information about the Python-list mailing list