Skip to content

Commit

Permalink
Fixed possible typos and optimizations in regular expressions (#31)
Browse files Browse the repository at this point in the history
* Fixed possible typos and optimizations in regular expressions

* [0-9A-Za-z_] is the same as \w
~~ * [s|S] the included pipe character for alternating between characters is not supported in a list [] and will cause the pipe character to be literally matched, any character in a list will be literally and optionally matched. [sS] will match either s or S.~~
* The expression [tT][eE][sS][tT] can be optimized to allow case-insensitive matching of "test" by including the (?i) option before the expression, and alternatively (?-i) after the expression to disable case-insensitive matching. E.g "(?i)test(?-i)ing" will match "TESTing" as well as "testing"

* fixed escapes and added another bugfix ($ sign)

Co-authored-by: Björn Sundling <[email protected]>
  • Loading branch information
mthreer and bjompen authored Oct 26, 2022
1 parent eac972f commit 5f87c54
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Source/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
{"_Firebase_URL":"firebaseio\\.com"},
{"_Amazon_MWS_Auth_Token":"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},
{"_Facebook_Access_Token":"EAACEdEose0cBA[0-9A-Za-z]+"},
{"_Facebook_OAuth":"[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*['|\"][0-9a-f]{32}['|\"]"},
{"_GitHub":"[g|G][i|I][t|T][h|H][u|U][b|B].*['|\"][0-9a-zA-Z]{35},40}['|\"]"},
{"_Generic_API_Key":"[a|A][p|P][i|I][_]?[k|K][e|E][y|Y].*['|\"][0-9a-zA-Z]{32},45}['|\"]"},
{"_Generic_Secret":"[s|S][e|E][c|C][r|R][e|E][t|T].*['|\"][0-9a-zA-Z]{32},45}['|\"]"},
{"_Google_API_Key":"AIza[0-9A-Za-z\\-_]{35}"},
{"_Google_Cloud_Platform_OAuth":"[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com"},
{"_Facebook_OAuth":"(?i)facebook(?-i).*['|\"][0-9a-f]{32}['|\"]"},
{"_GitHub":"(?i)github.*['|\"][0-9a-z]{35,40}['|\"]"},
{"_Generic_API_Key":"(?i)api_?key.*['|\"][0-9a-z]{32,45}['|\"]"},
{"_Generic_Secret":"(?i)secret.*['|\"][0-9a-z]{32,45}['|\"]"},
{"_Google_API_Key":"AIza[\\w\\-]{35}"},
{"_Google_Cloud_Platform_OAuth":"[0-9]+-\\w{32}\\.apps\\.googleusercontent\\.com"},
{"_Google_GCP_Service_account":"\"type\":\"service_account\""},
{"_Google_OAuth_Access_Token":"ya29\\.[0-9A-Za-z\\-_]+"},
{"_Heroku_API_Key":"[h|H][e|E][r|R][o|O][k|K][u|U].*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}"},
{"_MailChimp_API_Key":"[0-9a-f]{32}-us[0-9]{1},2}"},
{"_Google_OAuth_Access_Token":"ya29\\.[\\w\\-]+"},
{"_Heroku_API_Key":"(?i)heroku(?-i).*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}"},
{"_MailChimp_API_Key":"[0-9a-f]{32}-us[0-9]{1,2}"},
{"_Mailgun_API_Key":"key-[0-9a-zA-Z]{32}"},
{"_Password_in_URL":"[a-zA-Z]{3},10}://[^/\\s:@]{3},20}:[^/\\s:@]{3},20}@.{1},100}[\"'\\s]"},
{"_Password_in_URL":"[a-zA-Z]{3,10}://[^$][^/\\s:@]{3,20}:[^$][^/\\s:@]{3,20}@.{1,100}[\"'\\s]"},
{"_PayPal_Braintree_Access_Token":"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"},
{"_Picatic_API_Key":"sk_live_[0-9a-z]{32}"},
{"_Slack_Webhook":"https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}"},
{"_Slack_Webhook":"https://hooks.slack.com/services/T\\w{8}/B\\w{8}/\\w{24}"},
{"_Stripe_API_Key":"sk_live_[0-9a-zA-Z]{24}"},
{"_Stripe_Restricted_API_Key":"rk_live_[0-9a-zA-Z]{24}"},
{"_Square_Access_Token":"sq0atp-[0-9A-Za-z\\-_]{22}"},
{"_Square_OAuth_Secret":"sq0csp-[0-9A-Za-z\\-_]{43}"},
{"_Square_Access_Token":"sq0atp-[\\w\\-]{22}"},
{"_Square_OAuth_Secret":"sq0csp-[\\w\\-]{43}"},
{"_Twilio_API_Key":"SK[0-9a-fA-F]{32}"},
{"_Twitter_Access_Token":"[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*[1-9][0-9]+-[0-9a-zA-Z]{40}"},
{"_Twitter_OAuth":"[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*['|\"][0-9a-zA-Z]{35,44}['|\"]"}
{"_Twitter_Access_Token":"(?i)twitter.*[1-9][0-9]+-[0-9a-z]{40}"},
{"_Twitter_OAuth":"(?i)twitter.*['|\"][0-9a-z]{35,44}['|\"]"}
],
"fileextensions":[
".ps1",
Expand All @@ -68,4 +68,4 @@
]
}



0 comments on commit 5f87c54

Please sign in to comment.