Home Web Front-end JS Tutorial Regular expression to verify domestic mobile phone number and landline number

Regular expression to verify domestic mobile phone number and landline number

Mar 13, 2018 am 09:18 AM
Phone number

这次给大家带来验证国内手机号与座机号的正则表达式,验证国内手机号与座机号的正则表达式的注意事项有哪些,下面就是实战案例,一起来看一下。

验证手机号:^((13[0-9])|(14[7])|(15[^4,\\D])|(18[0,0-9])|(17[0,0-9]))\\d{8}$
验证座机和手机号:@"^(0(10|2[0-5789]|3\\d{2}|4\\d{2}|5\\d{2}|6\\d{2}|7\\d{2}|8\\d{2}|9\\d{2})\\d{7,8}$)|(0(10|2[0-5789]|3\\d{2}|4\\d{2}|5\\d{2}|6\\d{2}|7\\d{2}|8\\d{2}|9\\d{2})-\\d{7,8}$)|(\\d{7,8}$)|(((13[0-9])|(14[7])|(15[^4,\\D])|(18[0,0-9])|(17[0,0-9]))\\d{8}$)    (目前座机不支持分机号)
Copy after login

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

react.js的学习

Angular的新手教程

怎样用代码直观的表示mvvm原理

The above is the detailed content of Regular expression to verify domestic mobile phone number and landline number. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use Xiaohongshu account to find users? Can I find my mobile phone number? How to use Xiaohongshu account to find users? Can I find my mobile phone number? Mar 22, 2024 am 08:40 AM

How to use Xiaohongshu account to find users? Can I find my mobile phone number?

How to set up if WeChat does not allow adding by mobile phone number How to set up if WeChat does not allow adding by mobile phone number Mar 12, 2024 pm 05:04 PM

How to set up if WeChat does not allow adding by mobile phone number

What does the +86 in front of a mobile phone number mean? What does the +86 in front of a mobile phone number mean? Jan 12, 2021 pm 02:17 PM

What does the +86 in front of a mobile phone number mean?

How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? Mar 22, 2024 am 08:11 AM

How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number?

How to register two B-site numbers with one mobile phone number? How does Station B unbind its mobile phone? How to register two B-site numbers with one mobile phone number? How does Station B unbind its mobile phone? Mar 21, 2024 pm 10:10 PM

How to register two B-site numbers with one mobile phone number? How does Station B unbind its mobile phone?

What should I do if my railway 12306 mobile phone number has been changed and cannot be verified? What should I do if my railway 12306 mobile phone number has been changed and cannot be verified? Feb 28, 2024 am 09:00 AM

What should I do if my railway 12306 mobile phone number has been changed and cannot be verified?

Enter your mobile phone number to check the full list of express delivery entrance URLs with one click Enter your mobile phone number to check the full list of express delivery entrance URLs with one click Feb 14, 2024 pm 11:33 PM

Enter your mobile phone number to check the full list of express delivery entrance URLs with one click

How to change the bound mobile phone number of Meituan when I no longer use it but cannot receive the verification code? How to change the bound mobile phone number? How to change the bound mobile phone number of Meituan when I no longer use it but cannot receive the verification code? How to change the bound mobile phone number? Mar 12, 2024 am 11:28 AM

How to change the bound mobile phone number of Meituan when I no longer use it but cannot receive the verification code? How to change the bound mobile phone number?

See all articles