验证手机号码 [英] validating the mobile numbers

查看:123
本文介绍了验证手机号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个正前pression来验证所述移动数高达9位数字,如果电话号码开头8另有10位需要输入。编号必须开始或者以9或8个以上的标准。

解决方案

  ^(8 \ D {8} | [1-79] \ D {9})$
 

I need a regular expression to validate the mobile number up to 9 digits, if the telephone number starts with 8 otherwise 10 digits needs to be entered. The numbers must start either with 9 or 8 with above criteria.

解决方案

^(8\d{8}|[1-79]\d{9})$

这篇关于验证手机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆