mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2026-05-26 16:54:24 -04:00
Fix handling of word boundaries in Filter cog (#6725)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user