Skip to content

Commit 811e8d6

Browse files
committed
Copilot nits
1 parent e5ca5a9 commit 811e8d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guardrails/checks/text/keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def _compile_pattern(keywords: tuple[str, ...]) -> re.Pattern[str]:
8686
suffix = r"(?!\w)" if ends_with_word_char else ""
8787
patterns.append(f"{prefix}{escaped}{suffix}")
8888

89-
# (?<!\w) and (?!\w) emulate Unicode-aware word boundaries (letters, digits, underscore).
89+
# (?<!\w) and (?!\w) use Unicode-aware lookbehind/lookahead to enforce word boundaries.
9090
pattern_text = "(?:" + "|".join(patterns) + ")"
9191

92-
return re.compile(pattern_text, re.IGNORECASE | re.UNICODE)
92+
return re.compile(pattern_text, re.IGNORECASE)
9393

9494

9595
def match_keywords(

0 commit comments

Comments
 (0)