mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
Further optimized the regex (99% accuracy | 99/100 passing tests)
This commit is contained in:
2
.github/workflows/check-non-re2-regex.yml
vendored
2
.github/workflows/check-non-re2-regex.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
regex_usage_pattern='(^|[^A-Za-z0-9_"'"'"'`])(\/[^\/\n]+\/[gimsuyv]*|new RegExp\()'
|
||||
regex_usage_pattern='(^|[^A-Za-z0-9_"'`\.\/\\])(\/(?:\\.|[^\/\n\\])+\/[gimsuyv]*(?=\s*[\.\(;,)\]}:]|$)|new RegExp\()'
|
||||
|
||||
# Find all added lines that contain regex patterns
|
||||
if grep -E "$regex_usage_pattern" added_lines.txt > potential_violations.txt 2>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user