package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`([A-Z]\S*(?:\s+[a-z]\S*)?)\s+((?:[A-Z]\S*\s*)?(?:\b[^A-Z\s]\S*\s*)*)(?:\s+|$)`)
var str = `Machine washable Yes Color Clear Series Share Capacity 123 cl Category Vase Brand RandomBrand Item.nr 43140`
var substitution = "$1: $2\n"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/