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)
| 179 | // expression pattern. |
| 180 | // More complicated queries need to use Compile and the full Regexp interface. |
| 181 | func 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 | // |