MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkRegexp_MatchString

Function BenchmarkRegexp_MatchString

internal/re/regexp_test.go:141–149  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

139}
140
141func BenchmarkRegexp_MatchString(b *testing.B) {
142 var r = re.MustCompile("(?i)(onmouseover|onmousemove|onmousedown|onmouseup|onerror|onload|onclick|ondblclick|onkeydown|onkeyup|onkeypress)(\\s|%09|%0A|(\\+|%20))*(=|%3D)")
143 b.ResetTimer()
144
145 //b.Log("keywords:", r.Keywords())
146 for i := 0; i < b.N; i++ {
147 r.MatchString("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36")
148 }
149}
150
151func BenchmarkRegexp_MatchString2(b *testing.B) {
152 var r = regexp.MustCompile(`(?i)(onmouseover|onmousemove|onmousedown|onmouseup|onerror|onload|onclick|ondblclick|onkeydown|onkeyup|onkeypress)(\s|%09|%0A|(\+|%20))*(=|%3D)`)

Callers

nothing calls this directly

Calls 2

MustCompileFunction · 0.92
MatchStringMethod · 0.80

Tested by

no test coverage detected