package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?<=^\d+\. +).+?(?=\n|$)`)
var str = `
Open Ended Questions:
1. What makes Vue a popular choice for web development?
2. How does Vue compare to other JavaScript frameworks?
3. What are the advantages of using Vue?
Closed Ended Questions:
1. Does Vue support server-side rendering?
2. Is Vue compatible with TypeScript?
3. Does Vue have a built-in router?`
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/