Regular expressions for e-mail messages

Source: Internet
Author: User

One of the regular expressions that appears to be an e-mail message

\w+ ([-+.] \w) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *
or \[email protected]\s+\.\s+.
are common e-mail regular expressions

RegularExpressionValidator don't have to explain, the base control, verify that the input conforms to the


[......] Match any one of the characters in parentheses
[^ ...] Match any one character that is not in parentheses
\w Match (A~Z,A~Z,0~9)
\w matches any one whitespace character
\s matches any one non-whitespace character
\s matches any non-word character
\d matches any one number
\d matches any one non-numeric
[\b] matches a backspace key letter
{n,m} matches at least the preceding expression n times, up to M times
{N,} at least match the preceding expression n times
{n} exactly matches the preceding expression n times
Match the previous expression 0 or 1 times
+ Minimum match 1 times preceding expression
* min. Match previous expression 0 times
| match front or back expressions
(...) Combine items in a cell
^ Match string start
$ match End of string
\b Match character boundaries
\b A location that matches a non-character boundary

\w+ "\w represents the word character, including all the letters, all the numbers, the left and right underscore + indicates that the word character appears one or more times, but appears at least once"
([-+. '] \w+) * "[] the contents of the composition class, can only be the four characters one of the \w+ above said two brackets for grouping, that is, the parentheses inside as a whole * means that the content in parentheses appears 0 or more times"
@ "On behalf of himself"
\w+ "said above."
([-.] \w+) * "also said [] there is only one inside." represents any character except for line feeds and carriage returns "
\.\w+ "said above."
([-.] \w+) * "said above"

Regular expressions for e-mail messages

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.