From fffc1ac8b072ba8886d642632d233c6b4f751bc7 Mon Sep 17 00:00:00 2001 From: Sergey Zhilin Date: Thu, 18 May 2017 16:07:16 +0300 Subject: [PATCH] A little fix to upload.py get_current_emoji_list function had a greedy quantifier in regexp: "data-emoji-name=\"(.*)\"" I.e. for string like `data-emoji-name="parrot" data-action="emoji.remove"` it returns following result: `parrot" data-action="emoji.remove` In case of lazy quantifier ("data-emoji-name=\"(.*?)\"") the result will be correct:`parrot` --- upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload.py b/upload.py index acbddb49..cd1a0873 100755 --- a/upload.py +++ b/upload.py @@ -80,7 +80,7 @@ def main(): def get_current_emoji_list(session): r = session.get(session.url) r.raise_for_status() - x = re.findall("data-emoji-name=\"(.*)\"", r.text) + x = re.findall("data-emoji-name=\"(.*?)\"", r.text) return x