package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\d+\.\d+)|([^a-zA-Z]\d\d)|( \d )`)
var str = ` 1 Something Interesting here 2 More interesting text 2.1 An example of 2C19 a header 2.3 Another header example 2.4 another interesting header 10.1 header stuff 14 the last interesting 3A4 header`
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/