telco_server/tools/utils/utils.go

10 lines
197 B
Go
Raw Normal View History

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