package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`([Mm]on|[Tt](?:hurs|ues)|[Ww]ednes|[Ff]ri|[Ss](?:un|atur))(?: |,|day(?: |,|(?:'|)s))|[Ee]veryday|[Ww]eekday|[Ww]eekend`)
var str = `Wake me up Wednesdays, thursday's, and Friday at 7:15, and make this a nagging alarm. Repeat it every 10 minutes until 8:30.
Wake me up on the Weekends at 7:17 AM.
`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/