Advertisement
rfmonk

re_email_verbose.py

Jan 2nd, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import re
  5.  
  6. address = re.compile(
  7.     '''
  8.    [\w\d.+-]+          # username
  9.    @
  10.    ([\w\d.]+\.)+       # domain name prefix
  11.    (com|org|edu)       # TODO: support more top-level domains
  12.    ''',
  13.     re.UNICODE | re.VERBOSE)
  14.  
  15. candidates = [
  16. ]
  17.  
  18. for candidate in candidates:
  19.     match = address.search(candidate)
  20.     print '%-30s %s' % (candidate, 'Matches' if match else 'No match')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement