MatchString reports whether the string s contains any match of the pattern. This is a zero-allocation operation (like Rust's is_match). Example: re := coregex.MustCompile(`hello`) if re.MatchString("hello world") { println("matched!") }
(s string)
| 293 | // println("matched!") |
| 294 | // } |
| 295 | func (r *Regex) MatchString(s string) bool { |
| 296 | return r.engine.IsMatch(stringToBytes(s)) |
| 297 | } |
| 298 | |
| 299 | // Find returns a slice holding the text of the leftmost match in b. |
| 300 | // Returns nil if no match is found. |