// Go program to illustrate how to check
// the given regexp present in the given slice
package main
import (
"fmt"
"regexp"
)
// Main function
func main() {
// Creating and initializing
// slice of bytes
// Using shorthand declaration
s1 := []byte{'G', 'E', 'E', 'K', 'S', 'F', 'O',
'R', 'G', 'E', 'E', 'K', 'S'}
s2 := []byte{'g', 'f', 'g'}
// Pattern
p1 := "G"
p2 := "g"
p3 := "^^"
p4 := "@"
// Matching pattern
// Using Match() function
res1, e := regexp.Match(p1, s1)
fmt.Println("Result and Error is:", res1, e)
res2, e := regexp.Match(p2, s1)
fmt.Println("Result and Error is:", res2, e)
res3, e := regexp.Match(p3, s1)
fmt.Println("Result and Error is:", res3, e)
res4, e := regexp.Match(p4, s1)
fmt.Println("Result and Error is:", res4, e)
res5, e := regexp.Match(p1, s2)
fmt.Println("Result and Error is:", res5, e)
res6, e := regexp.Match(p2, s2)
fmt.Println("Result and Error is:", res6, e)
res7, e := regexp.Match(p3, s2)
fmt.Println("Result and Error is:", res7, e)
res8, e := regexp.Match(p4, s2)
fmt.Println("Result and Error is:", res8, e)
}