work 2333
Topic source1
# -*- coding: utf-8 -*-
import re
def is_valid_email(addr):
if re.match(r'^[\w\.]+?@[\w]+\.com$',str(addr)):
return True
else:
return False
2
# -*- coding: utf-8 -*-
import re
def name_of_email(addr):
m=re.match(r'^(<([\w ]+)>)?\s*(\w+)@[\w]+\.(com|org)$', str(addr))
if m[2]:
return m[2]
elif m[3]:
return m[3]
else:
return 'no match names'
- 1
Phioton