From c2d033e2d7dc2b49f696bee0e5cd121e70dd15cf Mon Sep 17 00:00:00 2001 From: Ramforth Date: Thu, 30 Oct 2025 19:04:14 +0100 Subject: [PATCH] Fix SyntaxError in emoji_pattern regex (correct multi-line raw string with re.VERBOSE) --- pytchat_listener.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pytchat_listener.py b/pytchat_listener.py index 771519f..9e23135 100644 --- a/pytchat_listener.py +++ b/pytchat_listener.py @@ -46,18 +46,18 @@ def main(): # Add coloring for standard emojis emoji_pattern = re.compile( - r"(" - r" # Start capturing group - r"\U0001F600-\U0001F64F" # emoticons - r"\U0001F300-\U0001F5FF" # symbols & pictographs - r"\U0001F680-\U0001F6FF" # transport & map symbols - r"\U0001F1E0-\U0001F1FF" # flags (iOS) - r"\U00002702-\U000027B0" # Dingbats - r"\U000024C2-\U0001F251" # Enclosed characters - r"\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs - r"\U0000200D" # Zero Width Joiner (for emoji sequences) - r"\U0000FE0F" # Variation Selector-16 (for emoji presentation) - r")+", re.UNICODE) + r"""( + \U0001F600-\U0001F64F # emoticons + \U0001F300-\U0001F5FF # symbols & pictographs + \U0001F680-\U0001F6FF # transport & map symbols + \U0001F1E0-\U0001F1FF # flags (iOS) + \U00002702-\U000027B0 # Dingbats + \U000024C2-\U0001F251 # Enclosed characters + \U0001F900-\U0001F9FF # Supplemental Symbols and Pictographs + \U0000200D # Zero Width Joiner (for emoji sequences) + \U0000FE0F # Variation Selector-16 (for emoji presentation) + )+""" + , re.UNICODE | re.VERBOSE) message_text = emoji_pattern.sub(r'[magenta]\1[/magenta]', message_text) # Alternate background styles