Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. _linkify_emails_regex = re.compile(r"([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*)@((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)", re.I)
  2.  
  3. In [2]: text._linkify_emails_regex.search('"Ken Mitton" <foobar@gmail.com>').group()
  4. Out[2]: 'foobar@gmail.com'
  5.  
  6. In [3]: text._linkify_emails_regex.search('"Ken Mitton" <foobar.@gmail.com>').group()
  7. ---------------------------------------------------------------------------
  8. <type 'exceptions.AttributeError'> Traceback (most recent call last)
  9.  
  10. /nail/home/derwiki/pg/yelp-main/<ipython console> in <module>()
  11.  
  12. <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'group'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement