Please take a look at the questions about email verification.

Source: Internet
Author: User
Tags ereg
For questions about email verification, please take a look at if (! Ereg (& quot; ^ [a-zA-Z0-9 _.] + @ ([a-zA-Z0-9 _] + .) + [a-zA-Z] {2, 3 }$ & quot;, $ email) {help me to see if this is correct? Can I verify the email addresses of all rules? Gsgsg@xx.comgsdg.ee @ xx.com.cntert_erw@xx.com in the mailbox is generally underlined "_ questions about mailbox verification, please help look at the Master
If (! Ereg ("^ [a-zA-Z0-9 _.] + @ ([a-zA-Z0-9 _] +.) + [a-zA-Z] {2, 3} $", $ email )){



Can you help me see the problem? Can I verify the email addresses of all rules?
Gsgsg@xx.com
Gsdg.ee@xx.com.cn
Tert_erw@xx.com

In addition, the email address is usually underlined with an underscore (_). However, someone suggested that the email address contains an underscore, how can I modify the above code so that the email address with the hyphen "-" can pass?
Rgter-fsf@xx.com

------ Solution --------------------
If (! Ereg ("^ [a-zA-Z0-9 _.-] + @ ([a-zA-Z0-9 _] +.) + [a-zA-Z] {2, 3} $", $ email )){

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.