Escape regex . (dot), they need to be literal

This commit is contained in:
obosob
2015-07-30 20:45:23 +00:00
parent f4ea094e93
commit aeff01ad00

View File

@@ -106,7 +106,7 @@ class BaseContent(object):
displayed through the terminal.
"""
reddit_link = re.compile("https?://(www.)?(np.)?redd(it.com|.it)/r/.*")
reddit_link = re.compile("https?://(www\.)?(np\.)?redd(it\.com|\.it)/r/.*")
reddit_link_no_host = re.compile("/r/.*")
author = getattr(sub, 'author', '[deleted]')
name = getattr(author, 'name', '[deleted]')