telco_server/tools/utils/utils.go

10 lines
197 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package utils
import "regexp"
func IsValidPhone(phone string) bool {
// 简单验证以1开头后面10位数字
reg := regexp.MustCompile(`^1[0-9]{10}$`)
return reg.MatchString(phone)
}