Skip to content

Fix SyntaxWarning from invalid escape sequences in regex patterns#466

Open
matthew-frank wants to merge 1 commit into
mlcommons:masterfrom
matthew-frank:matthew-frank/fix-syntax-warnings
Open

Fix SyntaxWarning from invalid escape sequences in regex patterns#466
matthew-frank wants to merge 1 commit into
mlcommons:masterfrom
matthew-frank:matthew-frank/fix-syntax-warnings

Conversation

@matthew-frank
Copy link
Copy Markdown
Contributor

Use raw strings for regex patterns in mlp_compliance.py and ruleset_060.py so that \w, \d, \s, and . are not parsed as Python string escapes. The resulting strings are identical, so matching behavior is unchanged; this only silences the SyntaxWarning emitted by modern Python.

Use raw strings for regex patterns in mlp_compliance.py and
ruleset_060.py so that \w, \d, \s, and \. are not parsed as Python
string escapes. The resulting strings are identical, so matching
behavior is unchanged; this only silences the SyntaxWarning emitted
by modern Python.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@matthew-frank matthew-frank requested review from a team as code owners May 29, 2026 15:39
@github-actions
Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants