package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\b(?:in|and|is)\s+((?:.(?!\b(?:in|and|is)\b))*(?:HomeStay|Luxury)(?:.(?!\b(?:in|and|is)\b))*)(?!.*(?:HomeStay|Luxury).*)`)
var str = `Hello, tonight I'm in the town of Trenton in Hotel HomeStay [123] in New Jersey and I will be staying in Hotel HomeStay [123] and I have no money. Actually, I'm wealthier than this guy outside, I will be staying in Hotel HomeStay [123] and I have tons of money. in Hotelin HomeStay [123in]. HomeStay and never gonna give you up, never gonna make you cry. This is Luxury, and a cheeseburger.
`
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/