文章目录
本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 Unported许可协议进行许可。允许非商业转载,但应注明作者及出处。
作者:liuyuan_jq
2011-03-30
(?<!noreply) # Ignore "noreply"
@[/w/d.+-]+ # Domain name
)$
''',
re.UNICODE | re.VERBOSE)
candidates = [
'first.last@example.com',
'user@example.org',
'ignored@example.co.uk',
'noreply@example.com',
]
for candidate in candidates:
# print '{0:25}'.format(candidate),
print '%25s' % (candidate,),
match = address.search(candidate)
if match:
print 'MATCH ', match.groups()
else:
print 'NO MATCH'
运行结果