简体   繁体   English

有效的手机号码国家/地区代码0092或+92的正则表达式

[英]RegEx for valid Mobile Phone Number country code 0092 or +92

Is there a standardised regular expression for all valid mobile phone numbers, eg 00923465655239, or +923005483426,00923335612513 i am searching it quit two days but i havnot found any expression for these format. 是否为所有有效的手机号码提供了标准化的正则表达式,例如00923465655239或+923005483426,00923335612513我正在搜索退出两天,但没有找到这些格式的任何表达式。

country code 0092 or +92 and mobile total numbers after 0092 are 10 numbers 国家/地区代码0092或+92,0092之后的移动电话总数为10

Advance thanks 预先感谢

I am not going to provide you an answer, I am going to provide you with a bit of information which you can read through and learn yourself how to use regex. 我不会为您提供答案,而是会为您提供一些信息,您可以阅读这些信息并学习如何使用正则表达式。

This search took me less than 5seconds to grab the URL for you. 这项搜索花了我不到5秒的时间为您获取了URL。

Here is a good regex phone number validation question 这是一个很好的正则表达式电话号码验证问题

This shows you with a lot of description how to use regex for validating phone numbers. 这为您提供了很多说明,如何使用正则表达式验证电话号码。 I suggest you take a read of this, make an attempt and then if you get stuck then we will be more than happy to help. 我建议您阅读一下,尝试一下,如果遇到困难,我们将非常乐意为您提供帮助。

If that proves difficult then use this link 如果证明困难,请使用此链接

$number =  "00923005483426" ; //Use another number to test   
$pattern = "/^(\+|00)92\d{10}$/" ;

$isOk = preg_match($pattern, $number) ;
var_dump($isOk) ;

Should do the work. 应该做的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM