本文介绍了普通的前pression用于验证阿联酋号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的正则表达式这也验证了阿联酋的手机号码就像

Currently I am using

^(\+971[\s]{0,1}[\-]{0,1}[\s]{0,1}|[\s]{0,1}0)(5[056]{1})[\s]{0,1}[\-]{0,1}[\s]{0,1}[1-9]{1}[0-9]{6}$

Could you help me please? I'm not really good with regular expressions...

解决方案

+971 (050) (123 4566) is invalid formatit should be +971 (50) (123 4566)

this will allow only number starting with50 (etisalat) 52 (du) 55 (du) 56 (etisalat)

/^5(0|2|5|6)\d{7}$/;

start with 5 and then matches either 0,2,5,6 and then 7 digits numbersbelow also should work starting with 9715 format

/^+9715(0|2|5|6)\d{7}$/;

这篇关于普通的前pression用于验证阿联酋号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 22:51