package main import ( "regexp" "time" "unicode" ) func isPlaceAddr(str string) bool { if isTelephone(str) { return false } regx,_ := regexp.Compile(specialaddr) result:=regx.FindString(str) if result !="" { return true } return false } func isTimestamp(i int64) bool { now:=time.Now().Unix() if i0 { return true } reg2:=`^(\d{2,4}-)?\d{7,8}$` regx2,_ := regexp.Compile(reg2) arr2:=regx2.FindAllString(str,-1) if len(arr2)>0 { return true } return false } func isChinese(str string) bool { var count int for _, v := range str { if unicode.Is(unicode.Han, v) { count++ break } } return count > 0 } func isChineseChar(str string) bool { for _, r := range str { if unicode.Is(unicode.Scripts["Han"], r) || (regexp.MustCompile("[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]").MatchString(string(r))) { return true } } return false }