Created
July 2, 2012 18:56
-
-
Save luztak/3034918 to your computer and use it in GitHub Desktop.
RegEx for [at] and urls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
at_user_filter = re.compile(r'(?:^|\W)@(\w+)') | |
email_filter = re.compile('(\w{1,63})@([A-Za-z0-9\.\-] ).(com|net|org|me|in|fm|co|biz|info|mobi|cc)') | |
#you can add suffixes by asking Google for domain suffix information. | |
url_filter = re.compile(u'((http(s|)|ftp)://|)(\w{0,}\.|)(\w{1,63}).(\w{2,4})((/((.*)|)|))') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@whtsky url实在晕……先不管了.