From fc78ca46f09df6259411ec6555513e34bee1c52d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 4 Aug 2021 15:40:46 +0200 Subject: [PATCH] better regex --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f4539c1..108ceee 100644 --- a/main.py +++ b/main.py @@ -33,7 +33,7 @@ class Listener(StreamListener): """Answer to tweets.""" if status._json["user"]["id"] in self.listOfFriendsID: if seniority(status._json["created_at"]): - tweetText = sub(r'https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~', '', sub(r'(?<=ui)i+', '', status._json["text"].lower())) + tweetText = sub(r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+", "", status._json["text"].lower()) lastWord = tweetText.split()[-1:][0].lower() if lastWord in universalBase: if lastWord in quoiBase: