检测整数:/^\d{1,}$/
检测数值(整数或者小数):/^\d+(\.\d+)?$/
检测字母:/^[a-zA-Z]{1,}$/
检测字母和数字的组合:/^[0-9a-zA-Z]{1,}$/
检测密码(字母、数字、@、_、~):/^[0-9a-zA-Z@_~]{1,}$/
检测QQ号码:/^\d{6,12}$/
检测邮箱:/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
检测手机号码:/^1[3|4|5|8][0-9]\d{8}$/
检测手机号码或座机号码:/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/
匹配格式:
检测URL:/^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$/
检测数值(整数或者小数):/^\d+(\.\d+)?$/
检测字母:/^[a-zA-Z]{1,}$/
检测字母和数字的组合:/^[0-9a-zA-Z]{1,}$/
检测密码(字母、数字、@、_、~):/^[0-9a-zA-Z@_~]{1,}$/
检测QQ号码:/^\d{6,12}$/
检测邮箱:/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
检测手机号码:/^1[3|4|5|8][0-9]\d{8}$/
检测手机号码或座机号码:/((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/
匹配格式:
- 11位手机号码
- 3-4位区号,7-8位直播号码,1-4位分机号,如:12345678901、1234-12345678-1234。
检测URL:/^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$/