regexp.Regexp.MatchString
standard libraryThe 173rd most-called standard-library method by production calls. Called 7,405 times across 723 modules; 5,739 of those run outside tests and generated code.
2% in production calls vs 2026-W37 (5,626 → 5,739)
- prod calls
- 5,739
- non-test, non-generated
- all calls
- 7,405
- total callsites
- modules
- 723
- distinct callers
- in loop
- 30%
- of prod calls
- in tests
- 18%
- 1,340 calls
- resolved
- 100%
- to a known target
resolution mix
How each call resolves
How each call was attributed. Only resolved kinds, where the target function is known, count toward the ranking. Interface dispatch and unresolved receivers are reported separately and never guessed. Read the taxonomy →
- Concrete method99%A method on a value whose type is known exactly.
- Embedded method<1%Reached through an embedded type.
- Method value<1%A method captured as a value, then called.
estimate
Estimated relative cost
Roughly 0.10× the estimated relative cost of fmt.Sprintf . Benchmarked at 410.2 ns/op × 5,739 production calls, normalized so fmt.Sprintf = 1.0.
This is not dollars and not a verdict. Per-op time depends heavily on inputs (argument sizes, contention, patterns), the benchmark ran on a single machine (darwin/arm64 (Apple Silicon), go1.26.0), and static call counts are not runtime frequency. How this is estimated →
who calls this
Notable callers
Production calls into Regexp.MatchString from notable Go projects. Open one on the map to see what else it hammers.
- Kubernetes 373 6%
- Terraform 272 5%
- Gitea 89 2%
- Cilium 68 1%
- InfluxDB 66 1%
where it's called
Callsites in the wild
12 representative callsites of 7,405, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
- in loop
- in loop
- in loop
-
cockroachdb/cockroach @v19.2.12+incompatible
in loop -
readeck/go-readability/v2 @v2.1.2
parser.go:543
in loop - in loop
- in loop
- in loop
- in loop
-
encr.dev @v1.58.6
v2/internals/testutil/testutil.go:176
in loop -
entgo.io/ent @v0.14.6
dialect/sql/schema/writer.go:127
in loop
top callers
The modules that reach for it
The modules that call Regexp.MatchString most in this snapshot.
- github.com/hashicorp/terraform-provider-aws2674%
- github.com/fish2018/pansou2614%
- github.com/kubernetes/kubernetes1903%
- github.com/microcosm-cc/bluemonday1502%
- github.com/envoyproxy/go-control-plane/envoy1342%
siblings
More from regexp
The other most-called members in this package. See all →