Verify the mailbox regular expression, including two level domain name mailbox, mobile phone number regular expression support 170th number segment

Source: Internet
Author: User

[0-9a-z] [a-z0-9\._-] {1,}@[a-z0-9-]{1,}[a-z0-9] (\.[ A-z]{1,}) +

Many of the verification mailboxes that were found on the Internet do not support the verification of mailbox of level two domain name

How to use JS

function checkemail (email) {     if (/^[0-9a-z][a-z0-9\._-]{1,}@[a-z0-9-]{1,}[a-z0-9] (\.[ A-z]{1,}) +$/. Test (email) {        returntrue;     }      return false ;}

How to use C #

classProgram {Static voidMain (string[] args) {Console.WriteLine (Checkemail ("[email protected]")); Console.WriteLine (Checkemail ("[email protected]")); Console.WriteLine (Checkemail ("[email protected]")); }         Public Static BOOLCheckemail (stringemail) {Regex reg=NewRegex (@"[0-9a-z][a-z0-9\._-]{1,}@[a-z0-9-]{1,}[a-z0-9] (\.[ A-z]{1,}) +", regexoptions.ignorecase); if(Reg. IsMatch (email)) {return true; }            return false; }    }

Phone number Same as

1[3,4,5,8,7][0-9]{9}

JS usage

/^1[3,4,5,8,7][0-9]{9}$/

C # Usage

@ "1[3,4,5,8,7][0-9]{9}"

Verify the mailbox regular expression, including the level two domain name mailbox, mobile phone number regular expression support 170th number segment

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.