views:

192

answers:

1

I need a regular expression and a way to extract email address from a html page.

code sample needs to be in python

+1  A: 
import re
re.compile(r"(?:^|\s)[-a-z0-9_.]+@(?:[-a-z0-9]+\.)+[a-z]{2,6}(?:\s|$)",re.IGNORECASE)
Ehsan
Yay! I'm safe from this address harvester just by using a plus sign in the local part!
Jouni K. Seppänen
Shush don't say that Jouni... now he will ask how to extract e-mails that have a plus sign in the local part...
Mike Keller
Why you vote down the comment? :-?
Ehsan
I guess because this question does not deserve an answer :)(I upmodded the downmod, because IMHO it was a bit harsh)
mawimawi