package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`([^,]*), ?([^ ]*) ([^ ]*) ([^ ]*) (\d*.?\d*)`)
var str = `Collins Farm, 43900 tomatoes 0.67 29413
Bart Smith Farms, 34910 cassavas 0.99 34560.9
Allen Farms, 117 coconuts 0.54 63.18`
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/