按国家/地区代码验证电话号码 [英] Validate a phone Number by country code

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

问题描述

我正在计算如何使用正则表达式来验证下面这种格式的phonenumber



345712332111.它应该从区号开始,即345

任何可以帮忙排序的人?

谢谢

Hi,i am figuring how to use a regular expression to validate phonenumber in this format below

345712332111.It should start with area code i.e 345
Any one who can help sort this?
Thanks

推荐答案

首先,你可以检查一下这个问题,以便快速解决问题/>
http://stackoverflow.com/questions/8908976/ c-sharp-regex-to-validate-phone-number [ ^ ]



http://stackoverflow.com/questions/8596088/c-sharp-regex-phone-number-check [ ^ ]



http://social.msdn.microsoft.com/Forums/en-US/96077498-1fbb-4e42-aeed-34c9538053cd/regular-expression-for-us-phone-number-in-c?forum=regexp [ ^ ]
First, you can check this for quick solution
http://stackoverflow.com/questions/8908976/c-sharp-regex-to-validate-phone-number[^]

http://stackoverflow.com/questions/8596088/c-sharp-regex-phone-number-check[^]

http://social.msdn.microsoft.com/Forums/en-US/96077498-1fbb-4e42-aeed-34c9538053cd/regular-expression-for-us-phone-number-in-c?forum=regexp[^]


试试这个
\(?\d{3}\)?-? *\d{3}-? *-?\d{6}



如果您尝试使用此代码,请使用此类型345- 712-332111。您可以根据您的意愿更改号码,或者点击此链接 http://stackoverflow.com/questions/18091324/regex-to- match-all-us-phone-number-formats [ ^ ]


这篇关于按国家/地区代码验证电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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