Fix handling of word boundaries in Filter cog (#6725)

This commit is contained in:
Evanroby
2026-05-23 08:39:32 +02:00
committed by GitHub
parent af4101f1dc
commit 17fea2f6dc
+1 -1
View File
@@ -475,7 +475,7 @@ class Filter(commands.Cog):
if word_list:
pattern = re.compile(
"|".join(rf"\b{re.escape(w)}\b" for w in word_list), flags=re.I
"|".join(rf"(?<!\w){re.escape(w)}(?!\w)" for w in word_list), flags=re.I
)
else:
pattern = None