提取所含A-Za-z的字符数
func GetEnglishNum(text string) int {
rCharacter := regexp.MustCompile("[a-zA-Z]")
return len(rCharacter.FindAllStringSubmatch(text,-1))
}
提取所含数字0-9的字符数
func GetNumberNum(text string) int {
rCharacter := regexp.MustCompile(`\d`)
return len(rCharacter.FindAllStringSubmatch(text,-1))
}
提取所含中文字符数
func GetChineseNum(text string) int {
num := 0
for _, char := range text{
if unicode.Is(unicode.Han, char){
num++
}
}
return num
}


