package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\d{1}\.\d{5,8}|0)\s`)
var str = `0.1766155 0.1658146 0.3464225 0.258326 1.040629 0.3123467 0.7877846 0.1264636 0.1854926 2.235324 0 0.3128409 0.5384811 0.2159374 0.1659985 0.2901815 0.08226276 0.1323811 0.1374549 0.04583898 0.1653796 0.02095086 0.1465107 `
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/