package main
import (
"fmt"
"regexp"
)
func main() {
pattern := regexp.MustCompile(`b.d`)
testStrings := []string{
"bud", // returns true (1)
"bid", // returns true (1)
"bed", // returns true (1)
"b d", // returns true (1)
"bat", // returns false (0)
"bd", // returns false (0)
"bead", // returns false (0)
}
for _, str := range testStrings {
match := pattern.MatchString(str)
fmt.Println(match)
}
}
/*
run:
true
true
true
true
false
false
false
*/