package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`.*(\?)`)
var str = `/maple-lodge-luxury-bed-and-breakfast/hotel/wanaka-nz.html?asq=1rrVgHWD%2ftbMPIK6tfFoOBewg1Z5%2buLS%2bSEDbaA%2fbS1Cje5wmB0pR0%2bLKktHrg4HC2IQVGwjWisHJHwdUYn88XKp1eogKj%2fzaqwNenpp8R5J8sYcWQ4ELgyWRz8zKFhqCpAzJy%2bIPcIhZIlXClDyysYo7iqvOXmWbg%2fTJAqzGDB7np8MbTsvr9hmeUc%2bP9lIlRlyZyrcrq%2fMBp7AbaEJbA%3d%3d&hotel=99830&tick=637329177909`
if len(re.FindStringIndex(str)) > 0 {
fmt.Println(re.FindString(str),"found at index",re.FindStringIndex(str)[0])
}
}
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/