Skip to content

Instantly share code, notes, and snippets.

@hehongwei44
Created July 5, 2014 08:50
Show Gist options
  • Select an option

  • Save hehongwei44/64ceba194958e6ebedfb to your computer and use it in GitHub Desktop.

Select an option

Save hehongwei44/64ceba194958e6ebedfb to your computer and use it in GitHub Desktop.
判断输入的参数是否是个合格的QQ号码
/**
*
* @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