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