Mention regex will now be restricted to ASCII (#1456)
This commit is contained in:
@@ -347,7 +347,7 @@ class Post:
|
|||||||
# support Unicode and a word/beginning of string delimiter at the beginning to ensure
|
# support Unicode and a word/beginning of string delimiter at the beginning to ensure
|
||||||
# that no email addresses join the list of mentions.
|
# that no email addresses join the list of mentions.
|
||||||
# http://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags/
|
# http://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags/
|
||||||
mention_regex = re.compile(r"(?:^|\W|_)(?:@)(\w(?:(?:\w|(?:\.(?!\.))){0,28}(?:\w))?)")
|
mention_regex = re.compile(r"(?:^|\W|_)(?:@)(\w(?:(?:\w|(?:\.(?!\.))){0,28}(?:\w))?)", re.ASCII)
|
||||||
return re.findall(mention_regex, self.caption.lower())
|
return re.findall(mention_regex, self.caption.lower())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Reference in New Issue
Block a user