Last active
March 10, 2016 06:53
-
-
Save xigang/3c1b25b34398f6537e22 to your computer and use it in GitHub Desktop.
对中国手机号的校验
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ( | |
| regular = "^(1[3-8][0-9]|14[57]|15[0-35-9]|18[07-9])\\d{8}$" | |
| ) | |
| func Validate(mobileNum string) bool { | |
| reg := regexp.MustCompile(regular) | |
| return reg.MatchString(mobileNum) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
对中国手机号的校验