1
0
Fork 0

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`
This commit is contained in:
Sergey Zhilin 2017-05-18 16:07:16 +03:00 committed by GitHub
parent d4c26e226a
commit fffc1ac8b0
1 changed files with 1 additions and 1 deletions

View File

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