MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / safeRegexMatch

Function safeRegexMatch

pkg/sql/security/scanner.go:335–340  ·  view source on GitHub ↗
(re *regexp.Regexp, s string)

Source from the content-addressed store, hash-verified

333const maxRegexInputLen = 10_000
334
335func safeRegexMatch(re *regexp.Regexp, s string) bool {
336 if len(s) > maxRegexInputLen {
337 s = s[:maxRegexInputLen]
338 }
339 return re.MatchString(s)
340}
341
342// initTautologyCapturePatterns initializes patterns used to detect raw-SQL tautologies.
343// Because Go's RE2 engine does not support backreferences, each pattern captures both

Callers 1

detectCommentPatternsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected