Add comma as operator for GenerateSemiGenericRegex (#1679)

* feat: add comma as operator for GenerateSemiGenericRegex

* test: fix tests.
This commit is contained in:
rmdwe authored and GitHub committed 2025-01-13 08:21:45 -06:00
1 parent ab38a46986
commit f0d4499064
4 files changed
+100 -99

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ const (
// commonly used assignment operators or function call
//language=regexp
operator = `(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)`
operator = `(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=|,)`
// boundaries for the secret
// \x60 = `
+1 -1
View File
@@ -93,11 +93,11 @@ func TestGenerateSemiGenericRegex(t *testing.T) {
"api_key <= xxx",
"api_key => xxx",
"api_key ?= xxx",
"api_key, xxx",
},
invalidStrings: []string{
"api_keyxxx",
"api_key\txxx", // potentially valid in a tab-separated file
"api_key, xxx",
"api_key; xxx",
"api_key<xxx>",
"api_key&xxx",