Common regular Expressions for authentication

Source: Internet
Author: User
Regular

China Telephone Number Verification
Matching forms such as: 0511-4405222 or 021-87888822 or 021-44055520-555 or (0511) 4405222
Regular expression "((d{3,4}) |d{3,4}-)? d{7,8} (-d{3}) *"

China ZIP Code Verification
Matching forms such as: 215421
Regular expression "D{6}"

E-mail authentication
Matching forms such as: justali@justdn.com
Regular expression "w+" ([-+.] w+) *@w+ ([-.] w+) *.w+ ([-.] w+) * "

ID Card Verification
Matching forms such as: 15-bit or 18-bit ID card
Regular expression "d{18}|d{15}"

Common Digital Verification
Regular expressions
"D{n}" n is a specified length
Length range of "d{n,m}" N to M

Illegal character validation
Match illegal character Furu:< > &/' |
Regular expression [^<>&/| ' \]+

Date validation
Matching forms such as: 20030718,030718
Scope: 1900--2099
Regular Expression (((19) {1}| ( {1}) d{2}) |d{2}) [01]{1}d{1}[0-3]{1}d{1}



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.