Match reports whether the byte slice b contains any match of the regular expression re.
package main import ( "fmt" "regexp" ) func main() { re := regexp.MustCompile(`foo.?`) fmt.Println(re.Match([]byte(`seafood fool`))) }