MCPcopy
hub / github.com/grafana/tempo / MatchString

Method MatchString

pkg/regexp/regexp.go:55–76  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

53}
54
55func (r *Regexp) MatchString(s string) bool {
56 // if we're memoizing check existing matches
57 if r.matches != nil {
58 if matched, ok := r.matches[s]; ok {
59 return matched
60 }
61 }
62
63 matched := false
64 for _, m := range r.matchers {
65 if m.MatchString(s) == r.shouldMatch {
66 matched = true
67 break
68 }
69 }
70
71 if r.matches != nil && len(r.matches) < maxMemoize {
72 r.matches[s] = matched
73 }
74
75 return matched
76}
77
78func (r *Regexp) Reset() {
79 if r.matches != nil {

Callers 8

TestRegexpMatchFunction · 0.95
MatchMethod · 0.95
validateRequestMethod · 0.80
executeMethod · 0.80
binOpExecuteScalarFunction · 0.80
MatchesMethod · 0.80
matchesAnyFilterFunction · 0.80
isEnvVarTypeErrorFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestRegexpMatchFunction · 0.76