Phone format 正则表达式

Malaysia Phone format


"^((\\+60(\\s|-)?)|0)(((?!0)(?!2)(?!80)(?!81)\\d{1,2})[1]?)(\\s|-)?\\d{2,4}(\\s|-)?\\d{4}$"


all landline + mobile + IP in these format:

0XY YYXX XXXX or +60 XY YYXX XXXX

X must be there, Y may or not may be there depend on which number
example:
012 345 6789 or +60 12 345 6789 (normal mobile)
03 1234 5678 or +60 1234 5678 (selangor fix line)
088 12 3456 or +60 88 12 3456 (sabah fix line)
0111 123 4567 or +60 111 123 4567 (new mobile format)

space does not matter (accept without space too) or can be replace with dash (-)

do not accept bracket (common style to let people know the number can be omitted for local or STD call)
do not accept number to singapore (02), brunei (080) or any other unused NDC
do not accept NSN without trunk prefix (you don’t give people 12-345 6789)
do not accept country code + NSN without international call prefix too. it will confused people to give full number with country code without the plus sign.
do not accept input from stupid people who do not know the different between country code and trunk prefix (+6 03 1234 5678)
do not accept input from stupid people who try to separate subscribe number wrongly (+6011 123 456)


Singapure Phone format


"^[689]\\d{3}(\\s)?\\d{4}$"


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值