package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`([\d,]+)[\s\D]*([\d,]+)[\s\D]*([\d,]+)[\s\D]*`)
var str = `23,6 x 34 x 17,1
14,5 x 55 x 22
14,5cm x 55 x 22cm
14,5cmx55x22cm
14,5 cmx55 cmx22 cm
`
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/