电话号码规则表达 [英] phone number regulr expression

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

问题描述

我如何使电话号码的正则表达式仅接受数字并仅以0或00或+开头,这非常感谢

how i make regular expression for phone number accepts only number and start with 0 or 00 or + only,thanks alot

推荐答案

请参阅以下有用的文章在"正则表达式"上.
30分钟正则表达式教程

这可能没有您所需的确切代码,但我相信它将帮助您学习非常有用的主题,例如"正则表达式".
Have a look at below useful article on "Regular Expression".
The 30 Minute Regex Tutorial

This may not have exact code of your requirement, but I am sure it will help you to learn very useful topic like "Regular Expression".


使用此
^(0{1,2}|\+)(\d)+
Use this
^(0{1,2}|\+)(\d)+



您也可以根据需要指定位数.
^(0 {1,2} | \ +)(\ d){10}

You can specify count of digits too if you wish.
^(0{1,2}|\+)(\d){10}


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

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