出现次数 counts := regexp.MustCompile("world").FindAllStringIndex("hello world world", -1) fmt.Println(len(counts))