using regex to pull out email addresses

Arne Ludwig arne at citde.net
Sat Mar 25 17:00:17 EST 2006


>>> senderlist="na nu ni at no.com hu ji at ja ku at pi.pa.po.jp fa hu"
>>> print [ s[0] for s in re.findall("(\w+@(\w+\.)+\w+)",senderlist) ]
['ni at no.com', 'ku at pi.pa.po.jp']




More information about the Python-list mailing list