light-core/util/validator.go
2024-12-17 22:28:48 +08:00

14 lines
213 B
Go

package util
import "regexp"
// 识别手机号码
func IsMobile(mobile string) bool {
result, _ := regexp.MatchString(`^(1[0-9][0-9]\d{4,8})$`, mobile)
if result {
return true
} else {
return false
}
}