Perfect Email Validation Regular expression _ regular expression

Source: Internet
Author: User
The inter-domain name format is as follows:
Domain names are composed of specific character sets, English letters, numbers, and "-" (that is, hyphens or minus signs) of each country's text, but neither the beginning nor the end can contain "-", "-" and "-" cannot appear continuously. The letters in the domain name are not case-insensitive. The domain name can be up to 60 bytes (including suffix. com,. NET,. org, and so on).

/^[a-z] ([a-z0-9]*[-_]?[ a-z0-9]+) *@ ([a-z0-9]*[-_]?[ a-z0-9]+) +[\.] [A-z] {2,3} ([\.] [A-z] {2})? $/i;

/content/I forms a case-insensitive regular expression;
^ Match start
$ match End
[A-z] e-mail prefix must be an English letter beginning

([A-z0-9]*[-_]? [a-z0-9]+) * and _a_2, AAA11, _1_a_2 match, and A1_, Aaff_33a_, A__aa mismatch, if it is a null character, is also a match, * represents 0 or more.
* Represents 0 or more preceding characters.
[a-z0-9]* matches 0 or more English letters or numbers
[-_]? Match 0 or 1 "-" because "-" cannot appear continuously
[a-z0-9]+ matches 1 or more English letters or numbers, because "-" can not be done as the end

@ must have a @
([A-z0-9]*[-_]? [a-z0-9]+] + see above ([a-z0-9]*[-_]?[ a-z0-9]+) * explanation, but cannot be null, + represents one or more.
[\.] The special character (.) As a normal character
[A-z] {2,3} matches 2 to 3 English letters, typically COM or net.
([\.] [A-z] {2})? Match 0 or 1 [\.] [A-z] {2} (for example, CN, etc.) I don't know. com.cn the last part is not all two digits, if not please modify {2} to {starting words, end words}

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.