package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\d{2,}|(x\d)|(\dx)|[^\W\d]+\d\w*|\d+[^\W\d]\w*`)
var str = `Red 1996 Corvette 2x - Matchbox
3 x SmartCar, broken 2nd door
White chevy F150, 1996
2nd edition Kindle (x3)
**1x** 2008 financial crash notice
Green bowl, cracked (stored in room 2A5)
Collectors Edition Beannie Baby, item 204/343
(6) Nissan window motors (1995-1998 ONLY)`
var substitution = "$1$2"
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/