Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: remove double-escaped backslashes in DLP regex patterns - #97

Merged
xichen1997 merged 1 commit into
mainfrom
fix/issue-90-dlp-regex-double-escape
Mar 30, 2026
Merged

fix: remove double-escaped backslashes in DLP regex patterns#97
xichen1997 merged 1 commit into
mainfrom
fix/issue-90-dlp-regex-double-escape

Conversation

@xichen1997

Copy link
Copy Markdown
Contributor

The onboard config generator used raw strings (r#"..."#) but wrote regex backslashes as \b instead of \b. In a raw string, backslashes are literal, so \b produces \b in the output TOML. TOML literal strings (single-quoted) also do not interpret escapes, so the regex engine received \b (literal backslash + b) instead of \b (word boundary).

This caused all DLP patterns (SSN, credit cards) to silently fail to match any input.

Fixes #90

The onboard config generator used raw strings (r#"..."#) but wrote
regex backslashes as \\b instead of \b.  In a raw string, backslashes
are literal, so \\b produces \\b in the output TOML.  TOML literal
strings (single-quoted) also do not interpret escapes, so the regex
engine received \\b (literal backslash + b) instead of \b (word
boundary).

This caused all DLP patterns (SSN, credit cards) to silently fail to
match any input.

Fixes #90
@xichen1997
xichen1997 added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit 6d16b20 Mar 30, 2026
4 checks passed
@xichen1997
xichen1997 deleted the fix/issue-90-dlp-regex-double-escape branch March 30, 2026 15:48
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.

clawshell onboard generates wrong clawshell.toml

1 participant