Verify the email address using the js regular expression.
The most common verification is email address verification. Websites are common. Various web scripts also use the regular expression to verify the entered email address and determine whether the
Use PHP to verify whether Email is correct. When you register on a forum, there is usually an e-mail address verification function. when you enter an invalid format, an error message will appear. We can use the e-mail address verification function when you register on a forum, when you enter an invalid format, an error message is displayed.
We can use the following rule expression
Ereg ("^ [a-zA-Z0-9 _] @
I have never known that this function is really unprofessional. Today read the "C + + Primer" to the string this chapter just understand a lot of very convenient play:BOOL Verify_email (const std::string Email) {Const std::string verify_code = "[email protected]"; if (email.find_ First_not_of (verify_code)! = Std::string::npos) return False;return true; Find_first_not_of means to look for verify_code insid
Verify that the account is validVerification rules: a combination of letters, numbers, and underscores. It must start with a letter and contain 4-16 characters.
FunctionCheckuser (STR ){VaRRe=/^ [A-Za-Z] \ W {3, 15} $/;If(Re. Test (STR) {alert ("Correct");}Else{Alert ("Error") ;}} Checkuser ("jiade_cnblogs");//Call
Verify mobile phone numberVerification rules: 11-digit number, starting with 1.
Funct
Use a regular expression to verify the email address and mobile phone number
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform to a certain syntax rule.
Regular expression
Use a regular expression to verify the email address and mobile phone number.
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform to a certain syntax rule.
Regular expressio
This article describes how to add custom verification rules for queryvalidate to verify email addresses and zip codes. For more information, see add custom verification using jQuery: validate.
JQuery. validator. addMethod add custom verification rules
AddMethod: name, method, message
Simple Example: add a single verification
The Code is as follows:
Validate. js extension Verification
This article describes how to add custom verification rules for queryvalidate to verify email addresses and zip codes. For more information, see add custom verification using jQuery: validate.
JQuery. validator. addMethod add custom verification rules
AddMethod: name, method, message
Simple Example: add a single verification
The Code is as follows:
Validate. js extension Verification
The main code for verifying the email format is as follows:
Public bool isemail (string str_email)
{
Return System. text. regularexpressions. regEx. ismatch (str_email, @ "^ ([/W-/.] +) @ (/[0-9] {1, 3 }/. [0-9] {1, 3 }/. [0-9] {1, 3 }/.) | ([/W-] + /.) +) ([A-Za-Z] {2, 4} | [0-9] {1, 3}) (/)?] $ ");
}
The main code for verifying the IP address format is as follows:
Public bool ipcheck (string IP)
{
String num = "(25 [0-5] | 2 [0-4] // d | [0-1] // d
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.