Regular expression verification email address and phone number

Source: Internet
Author: User
Regular expression verification email address and phone number

Verify the regular expression of the phone number:(\ D {3}-) (\ d {8}) $ | (\ d {4}-) (\ d {7 }) $ | (\ d {4}-) (\ d {8}) $

(The new phone number is used here)

Verify the regular expression in the email address:\ W + ([-+.] \ w +) * @ \ w + ([-.] \ w + )*\. \ w + ([-.] \ w + )*

\ W any case English letter 0-9 digit underline + at least 1 character or more
[-+.] \ W + any combination of-+. and \ w characters appears 0 or multiple times

@ Fixed symbol

\ W + contains at least 1 x w character
[-.] \ W + contains zero or multiple character combinations

\. Fixed symbol

Anyway, the combination of \ w + ([-.] \ w +) * requires that it start with a letter of the \ w type, and then follow the combination of \ w and-dashes and dots.

Email regex verificationThat is

The email address must start with a letter (uppercase or lowercase), a number, or an underscore,

It can be followed by any \ w character and a hyphen plus sign (+ ).@Start with any \ w character and hyphen plus sign (+).Start with any \ w character and hyphen plus sign (+)

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.