需要有关Regex电话号码的帮助 [英] Need help on Regex Phone number

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

问题描述

大家好,



我写了一个匹配几乎所有国际电话号码的正则表达式。这是

^((\ +)?[0-9] {1,4})?([ - \\\\ /])?((\( \d {1,4} \))|?\d {1,4})(([ - \s\.\ /])[0-9] {1,6}){ 2,6}(\??(ext | x)\ s?[0-9] {1,6})?$





但这与格式+(603)4563789不匹配。它确实匹配+6034563789和(603)3293443但它与+和()的组合不匹配...请帮助。



谢谢。

解决方案







但这与格式+(603)4563789不符。它确实匹配+6034563789和(603)3293443,但它与+和()的组合不匹配...请帮助。



谢谢。

看看这里: http://regexlib.com/DisplayPatterns.aspx ?categoryId = 7& AspxAutoDetectCookieSupport = 1 [ ^ ]

Hi All,

I wrote a Regex that matches almost many international phone numbers. It is
^((\+)?[0-9]{1,4})?([-\s\.\/])?((\(\d{1,4}\))|\d{1,4})(([-\s\.\/])?[0-9]{1,6}){2,6}(\s?(ext|x)\s?[0-9]{1,6})?$


but this does not match the format +(603)4563789. It does match the +6034563789 and (603)3293443 but it does not match the combination of + and ()...Please help.

Thanks.

解决方案




but this does not match the format +(603)4563789. It does match the +6034563789 and (603)3293443 but it does not match the combination of + and ()...Please help.

Thanks.


Have a look here: http://regexlib.com/DisplayPatterns.aspx?categoryId=7&AspxAutoDetectCookieSupport=1[^]


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

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