Created
July 5, 2014 08:50
-
-
Save hehongwei44/64ceba194958e6ebedfb to your computer and use it in GitHub Desktop.
判断输入的参数是否是个合格的QQ号码
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
| /** | |
| * | |
| * @descrition:判断输入的参数是否是个合格的QQ号码 | |
| * @param->str:待验证的参数 | |
| * @return: true验证成功 | |
| */ | |
| var isQQ = function(str) { | |
| /** | |
| *@descrition:规则 | |
| * 1-9开头,最少5位。 | |
| */ | |
| var pattern = /^[1-9][0-9]{4,}$/ | |
| return pattern.test(str); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment