Skip to content

Commit

Permalink
A little fix to upload.py
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
ZhilinS authored May 18, 2017
1 parent d4c26e2 commit fffc1ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit fffc1ac

Please sign in to comment.