Alibabacloud.com offers a wide variety of articles about regular expression to validate email address, easily find your regular expression to validate email address information here online.
Mobile phone number verification (13 opening and 158,159 beginning, total 11 digits)
Copy Code code as follows:
var re;
var Ss=document.getelementbyid (' TextBox3 '). Value;
Re=/^ (13[0-9]{9}) | (15[89][0-9]{8}) $/
if (Re.test (ss))
{
document.getElementById (' Label3 '). innertext= ""; Assign value to label with InnerText
}
Else
{
document.getElementById (' Label3 '). innertext= "Please enter the correct cell phone number!" ";
document.getElementById (' ImageB
Comparison | function | The following function can check the email address format, only in the form of:
ABC@ABC.ABC,ABC@ABC.ABC.ABC and ABC@ABC.ABC.ABC.ABC-like strings to pass the check,
The following illegal addresses will not pass:
@abc @163.net,abc@163..net,abc@163.net.,abc@163@net and so on can be struck out.
What are the e-mail addresses in these formats? Like what:
swuse@yeah.net,liaojiayuan@btamai
Part 1ArticleWe use the string SEARCH method to verify the ASP email address. It may be a friend who prefers regular expressions.Code.Method 1
Copy code The Code is as follows: public function chkmail (byval email)
Dim rep, pmail: chkmail = true: Set rep = new Regexp
Rep. pattern = "([. a-zA-Z0-9 _-]) {} @ ([a-zA-Z0
[PHP] code The code is as follows:Copy code Function extract_emails ($ str ){// This regular expression extracts all emails from a string:$ Regexp = '/([a-z0-9 _.-]) + @ ([a-z0-9-]) +.) + ([a-z0-9] {2, 4}) +/I ';Preg_match_all ($ regexp, $ str, $ m );Return isset ($ m [0])? $ M [0]: array ();}$ Test_string = 'This is a test string...Test1@example.orgTest different formats:Test2@example.org;S
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.
FunctionCheckmobile (STR ){VaRRe=/^ 1 \ D {10} $/If(Re. Test (STR) {alert ("Correct");}Else{Ale
browsers are not necessarily compatible with Microsoft and Netscape, So it is likely that the client's JavaScript will not accurately verify the user input of various data, and the ASP program is running on the server side, but with your server environment, regardless of what the client browser, for your ASP program is no difference, Therefore, it is a good choice to use the backend ASP program to validate the data legality. When using ASP to verify
browsers are not necessarily compatible with Microsoft and Netscape, So it is likely that the client's JavaScript will not accurately verify the user input of various data, and the ASP program is running on the server side, but with your server environment, regardless of what the client browser, for your ASP program is no difference, Therefore, it is a good choice to use the backend ASP program to validate the data legality.
When using ASP to verify
browsers are not necessarily compatible with Microsoft and Netscape, So it is likely that the client's JavaScript will not accurately verify the user input of various data, and the ASP program is running on the server side, but with your server environment, regardless of what the client browser, for your ASP program is no difference, Therefore, it is a good choice to use the backend ASP program to validate the data legality. When using ASP to verify
This article illustrates how jquery uses regular expressions to validate email addresses. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
Enter Email address:
PS: Here again for you to provide
@qq.com.cn
Fuyongjie@163.com
Hh@qq.com
Fuyongjie.100@yahoo.com
[4] => fu-1999@sina.com
) 3. comparison: the regular expressions in 2nd do not contain the ^ and $ Values of 1st;
View instances again
The code is as follows:Function funcemail ($ str) // email regular expression{Return (preg_match ('/^ [_. 0-9a-z-a-z-] +
What is a regular expression
A regular expression (regular expression), in computer science, refers to a single string that describes or matches a series of strings that conform to a certain syntactic rule. In many text editors o
$;
See the example again
Code to copy code as followsfunction Funcemail ($STR)//mailbox Regular expression{Return (Preg_match ('/^[_.0-9a-z-a-z-]+@ ([0-9a-z][0-9a-z-]+.) +[a-z]{2,4}$/', $str))? True:false;}//Verification Method One
$str = "qbcd@126.com.cn";Preg_match ("/^[0-9a-z]+@ ([0-9a-z]+) [.]) +[a-z]{2,3}$/", $str, $re);Print_r ($re);//e-mail authentication two
if (eregi ("^[_.0-9a-z-]+@" ([0-9a-z][0
PHP combined with regular batch crawl email address in the Web page, crawl email address
PHP How to crawl the e-mail address in the Web page, below I would like to share with you a PHP crawl Web pages of the e-mail instance.
Met
the same as JavaScript, plus some browsers are not necessarily compatible with Microsoft and Netscape, So it is likely that the client's JavaScript will not accurately verify the user input of various data, and the ASP program is running on the server side, but with your server environment, regardless of what the client browser, for your ASP program is no difference, Therefore, it is a good choice to use the backend ASP program to validate the data l
Objects | data | Regular expression objects in the ASP validate the legality of the data
(Author: Su Hongsu March 27, 2000 13:35)
When we make a website, especially a variety of e-commerce sites, first of all, we will allow users to fill out a number of forms to obtain registered users of various information, because users can enter a wide range of information,
entered email address // var emailreg1 =/^ \ w + ([-+.] \ w +) * @ ("@") \ w + ([-.] \ w + )*\. \ w + ([-.] \ w +) * $/; // This can also be var emailreg =/^ \ w + (-\ w +) | (\. \ w +) * \ @ ("@") [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $/; if (emailreg. test (emailvalue )){}
ID card:
Var userCardvalue = $ ("# UserIDCard "). val (); // obtain the input ID card var userCardreg =/(^ \ d {15}
When it comes to regular expressions, there are a lot of common expressions on the web, but in fact, the general people are unwilling to go to the study, is to take it directly with the line. However, in fact, there may be times when the actual situation in the project or the company is different, we have to modify the regular expression, according to the actual
Validate the legality of the data in a "Regular Expression object" in ASP
When we make a website, especially a variety of e-commerce sites, first of all, we will allow users to fill out a number of forms to obtain registered users of various information, because users can enter a wide range of information, and some do not meet the requirements of the data will gi
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.