2006-12-28

Mostly functional email regex

for word based delims in text:
em = re.compile(r"\b['A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b",
re.IGNORECASE)


for start and endline delims:
em = re.compile(r"^['A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$",
re.IGNORECASE)

No comments: