From d8d268f86171b43ea284420d5af2d7e1b3f1c495 Mon Sep 17 00:00:00 2001 From: MiguelX413 Date: Fri, 18 Mar 2022 06:57:28 -0700 Subject: [PATCH] Mention regex will now be restricted to ASCII (#1456) --- instaloader/structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instaloader/structures.py b/instaloader/structures.py index 8b1f363..eb1d979 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -347,7 +347,7 @@ class Post: # support Unicode and a word/beginning of string delimiter at the beginning to ensure # that no email addresses join the list of mentions. # 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()) @property