Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _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)
- In [2]: text._linkify_emails_regex.search('"Ken Mitton" <foobar@gmail.com>').group()
- Out[2]: 'foobar@gmail.com'
- In [3]: text._linkify_emails_regex.search('"Ken Mitton" <foobar.@gmail.com>').group()
- ---------------------------------------------------------------------------
- <type 'exceptions.AttributeError'> Traceback (most recent call last)
- /nail/home/derwiki/pg/yelp-main/<ipython console> in <module>()
- <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'group'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement