package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?x)
\d+ # at least one digit
\. # a period
\s # a space
[^\d]+ # not a digit, 1 or more of them
\s+ # a space, 1 or more of them
`)
var str = ` 1. Which is your primary browser for development 2. Which of the following technologies have you made use of? 2. Which of the following technologies have you made use of? 3. How old `
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/