Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import re
- address = re.compile(
- '''
- [\w\d.+-]+ # username
- @
- ([\w\d.]+\.)+ # domain name prefix
- (com|org|edu) # TODO: support more top-level domains
- ''',
- re.UNICODE | re.VERBOSE)
- candidates = [
- ]
- for candidate in candidates:
- match = address.search(candidate)
- print '%-30s %s' % (candidate, 'Matches' if match else 'No match')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement