paquete principal importaciones ( " FMT " " expresión regular " ) func main () { str: = " abc123456 " partido, err: = regexp.Match ( " \ u4e00 " , [] bytes (str)) fmt.Println (partido, err) matchstring, err: = regexp.MatchString ( " \\ d " , str) fmt.Println (matchstring, err) nombre, _: = regexp.Compile ( " \\ w {4,6} " ) x: = name.Match ([] byte ( " abcdefghalfd; hjkadsfjlk " )) fmt.Println (x, err) edad: = regexp.MustCompile ( " \\ d " ) fmt.Println (age.Match ([] byte ( " 12345 " ))) fmt.Println (age.MatchString ( " 12345 " )) fmt.Println ( Cadena (age.ReplaceAll ([] byte ( " Mi país 1 2 3 4 5 " ), [] byte ( "" )))) fmt.Println (age.Split ( " Mi país 1 2 3 4 5 " , 7 )) }