package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)^(Where|How|Is|Does|I wanna|I want|I wish)\b.*\bdemo( game| version( of the game)?)?( exist| available| out there)?(\.|\?|!)*?$`)
var str = `How can I download the demo
Where get demo?!?!
where is the demo version of the game?
How do I get the demo game!
Anyone know how to get the demo?
How does one download a geneshit
so I was wondering, how do we get more newbies to play the demo
Does a demo version of the game exist?!?!?
Is a demo version of the game available
is a demo version of the game out there
Is there a demo version?
I wish there was a demo version
is a demo out there?`
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/