package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)[a-zA-Z0-9\x{4e00}-\x{9fa5}]+`)
var str = `What Does the Fox Say? 12 狐狸怎叫 34
What Does the shiba inu say? 柴犬怎叫
蘋果公司,原稱蘋果電 腦公司,是總部位於美國加州庫比蒂諾的跨國科技公司,與亞馬遜,Google、微軟和Meta一起被認為是五大技術公司之一,合稱為MAMAA。
現時的業務包括設計、開發、手機通信和銷售消費電子、電腦軟體、線上服務和個人電腦。`
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/