adding UNICODE flag to regex pattern

This commit is contained in:
vvzvlad
2025-03-22 15:11:30 +03:00
parent 5f5128fed0
commit 93698e0d4e
+2 -2
View File
@@ -200,8 +200,8 @@ async def _render_messages_groups(messages_groups, post_parser, exclude_flags: s
# Filter posts by exclude_text
if exclude_text:
# Compile single regex pattern
exclude_pattern = re.compile(exclude_text.strip(), re.IGNORECASE)
# Compile single regex pattern with UNICODE flag for proper handling of non-ASCII characters
exclude_pattern = re.compile(exclude_text.strip(), re.IGNORECASE | re.UNICODE)
filtered_posts = []
for post in rendered_posts:
# Check if pattern matches the post text