package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\((\w+)\/(.*?)\))|([^\( ]+)`)
var str = `(wav/cc331_a.wav) $vsInpDateTTS (wav/) (wav/b809.wav)
(wav/cc322_b.wav) (num/110)年(num/10)月測試1 (wav/cc322_c.wav)
`
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/