13 lines
254 B
Go
13 lines
254 B
Go
package utils
|
|
|
|
import "regexp"
|
|
|
|
// RegexpMobile 手机号匹配
|
|
func RegexpMobile(mobile string) bool {
|
|
ok, err := regexp.MatchString(`^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$`, mobile)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
return ok
|
|
}
|