MCPcopy Create free account
hub / github.com/coregx/coregex / ExampleMustCompile

Function ExampleMustCompile

example_test.go:21–25  ·  view source on GitHub ↗

ExampleMustCompile demonstrates panic-on-error compilation.

()

Source from the content-addressed store, hash-verified

19
20// ExampleMustCompile demonstrates panic-on-error compilation.
21func ExampleMustCompile() {
22 re := coregex.MustCompile(`hello`)
23 fmt.Println(re.MatchString("hello world"))
24 // Output: true
25}
26
27// ExampleRegex_Find demonstrates finding the first match.
28func ExampleRegex_Find() {

Callers

nothing calls this directly

Calls 2

MustCompileFunction · 0.92
MatchStringMethod · 0.80

Tested by

no test coverage detected