那个怎么样?查看 正则表达式package mainimport ( "regexp" "fmt")func main() { var re = regexp.MustCompile(`(?mi)id=([^,]+)`) var str = `id=PS\\ Old\\ Gen, value=34 and id=Code\\ Cache,value=22` for i, match := range re.FindAllString(str, -1) { fmt.Println(match, "found at index", i) }}