Skip to content

Commit 17fea2f

Browse files
authored
Fix handling of word boundaries in Filter cog (#6725)
1 parent af4101f commit 17fea2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

redbot/cogs/filter/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ async def filter_hits(
475475

476476
if word_list:
477477
pattern = re.compile(
478-
"|".join(rf"\b{re.escape(w)}\b" for w in word_list), flags=re.I
478+
"|".join(rf"(?<!\w){re.escape(w)}(?!\w)" for w in word_list), flags=re.I
479479
)
480480
else:
481481
pattern = None

0 commit comments

Comments
 (0)