package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)([\d:\.]*?)\s+?(\d+?)\s+?([\d:\.]*?)\s+?(\d+?)\s+?(\d+?)\n`)
var str = `concept 2.
View Detail
2000m
Mar 31 2018
time meter 500m in
6:48.9 2000 1:42.2 45
1:47.2 500 1:42.2 45
1:42.2 1000 1:42.2 45
1:42.2 1500 1:42.2 45
1:42.2 2000 1:42.2 45
Units
Display`
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/