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

Function MatchString

regex.go:181–187  ·  view source on GitHub ↗

MatchString reports whether the string s contains any match of the regular expression pattern. More complicated queries need to use Compile and the full Regexp interface.

(pattern string, s string)

Source from the content-addressed store, hash-verified

179// expression pattern.
180// More complicated queries need to use Compile and the full Regexp interface.
181func MatchString(pattern string, s string) (matched bool, err error) {
182 re, err := Compile(pattern)
183 if err != nil {
184 return false, err
185 }
186 return re.MatchString(s), nil
187}
188
189// CompileWithConfig compiles a pattern with custom configuration.
190//

Callers 1

Calls 2

MatchStringMethod · 0.80
CompileFunction · 0.70

Tested by 1