Phone-Phone regular expressions

Source: Internet
Author: User
The code is as follows Copy Code

/^[0-9-]{6,13}$/Phone Number
/^ (1) [0-9]{10}$/mobile number

The other side of the law

The code is as follows Copy Code

Verify the correctness of the phone number: ^0{0,1}13[0-9]{9}$

Verify the correctness of the phone number: (^[0-9]{3,4}-[0-9]{3,8}$) | (^[0-9]{3,8}$)

Support extension of

The code is as follows Copy Code

"^ (13[0-9]{9}| [0-9] {7,8}|0[0-9]{2,3}-[0-9]{7,8} (-[0-9]{0-4})? $ "

For example, the following numbers can be passed:

13704885252
4125663
42563256
024-44587856
024-44587856-01
024-44587856-012
024-44587856-0123
024-4458785
024-4458785-01
024-4458785-012
024-4458785-0123


Related articles
Http://www.111cn.net/wy/99/33225.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.