1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-08-18 04:39:39 +02:00

Mention regex will now be restricted to ASCII (#1456)

This commit is contained in:
MiguelX413 2022-03-18 06:57:28 -07:00 committed by GitHub
parent 463ada519e
commit d8d268f861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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