Regexp.Match in Go

Posted by GoDoc
Public (Editable by Users)

Match reports whether the byte slice b contains any match of the regular expression re.

Go
Edit
package main

import (
	"fmt"
	"regexp"
)

func main() {
	re := regexp.MustCompile(`foo.?`)
	fmt.Println(re.Match([]byte(`seafood fool`)))
}