email validation in javascript using regular expression
email validation in javascript using regular expression
Discover email validation in javascript using regular expression, include the articles, news, trends, analysis and practical advice about email validation in javascript using regular expression on alibabacloud.com
using capture references for storage and comparison and verification. Think of it as an exercise question (it suddenly seems like a math question in high school ).
The instance code is as follows:
Test: Use a Javascript Regular Expression to verify the Email address
E
Verify IPfunction IsIP (ipstr) {var reg =/^ (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. ( \D{1,2}|1\D\D|2[0-4]\D|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) $/g;return Ipstr.match (reg);}The regular verification of this URL is comprehensive, it verifies that the situation includes IP, domain name, FTP, level two domain name, the domain name of the file, domain name plus port! User name, etc. informationfunction Isurl (str_
This article mainly introduces the format of the JS Regular Expression verification mailbox. If you need some help, you can refer to it and hope to help us with WEB development. form verification is essential, so today we will list some common verification items, I hope you can criticize and correct the JS regular expression
Use the js regular expression to verify the mobile phone number, email address, and zip code. If you want to verify your mobile phone number, you can refer to it for reference. (11 digits are entered at the beginning of "13" and "158,159)
The Code is as follows:
Var re;Var ss = document. getElementById ('textbox3 '). value;Re =/^ (13 [0-9] {9}) | (15 [89] [0-9]
, -}$ the correct format is: Start with a letter, length in 6-18, only characters, numbers, and underscores can be included. Verify that you contain^%',; =?$\ "and other characters:[^%',; =?$\x22]+Verify Kanji:^[\u4e00-\u9fa5],{0,}$ Verify email address:^\w+[-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$ verify InternetURL:^http://([\w-]+\.) +[\w-]+ (/[\w-./?%=]*)? $; ^[a-za-z]+://(w+ (-w+) *) (. ( w+ (-w+) *) * (? s*)? $ verify Phone Number:^ (\ (\d
The most common verification is email address verification. Websites are common. Various web scripts also use regular expressions "(Regular Expression) Verify the email address we entered to determine whether the email address is
, including excepting, 1, 3, 5, 7, 8, 10, December all included 31st(0[13578]|1[02])-31)All other dates except February 29 in a leap year(?! 0000) [0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-8]) | ( 0[13-9]|1[0-2])-(29|30) | (0[13578]|1[02])-31)
Then we'll solve the second difficulty: Leap year considerations. Based on the definition of leap years, we can divide a leap year into two categories:
1 years that can be divisible by 4 but not divisible by 100. Looking for the change rule of the latt
1. The type attribute of input in html5 already has tel, number, and email. Do I need to write regular expressions for verification? 2. In html5, a total of 13 new types of input type attributes are added. I have summarized these 13 attributes, namely, the type attributes: color (define color picker), date (set... 1. The type attribute of input in html5 already has tel, number, and
The regular expression validation password feature is often used in the project, but a lot of friends still do not use the password regular expression to verify, this article small series for everyone to organize the PHP password verification
######################## Author: Rain wave All rights reserved, duplicate say ##qq:270499458 ########################Recently some friends who have just learned regular expressions ask me how to use in ASP. Oh Although it is simple, write it, the basic knowledge of regular expressions I will not say. In fact, there are many such articles. :(##### function Code ########assumed to be myfunc.asp'
Common regular expression of the encyclopedia! (For example: matching Chinese, matching HTML)
Matching regular expressions for Chinese characters: [U4E00-U9FA5]
Commentary: Matching Chinese is really a headache, with this expression will be easy to do
Match Double-byte characters (including Chinese characters): [^x0
Regular Expression (including Hong Kong, Macao and Taiwan) and jQuery Regular Expression for verifying mobile phone number email ID card
I have never used the regular expression verific
The regular expression verifies the ID card number and email address, determines the checked selected status, and the regular expression checked
The project is well written to login registration. When the blur event is used to verify user input content, a bug occurs. Finally
Php Regular Expression verification (email address, Url address, phone number, zip code), regular expression url
Content to be verified in this example:Email Address, Url address, phone number, zip codeThe verification method is shared with you for your reference. The detail
−z0−9]+\.[ a−za−z0−9]+[\/=\?/Idcard:/^\d{15} (\d{2}[a-za-z0-9)?/qq:/[1−9]\d4,8/qq:/[1−9]\d4,8/
A special Amount:/^ ((\d{1,3} (, \d{3}) *) | ( \d+)) (\.\d{2})? $/
Note: In addition to the "XXX xx,xxx xx,xxx.00" format
for the above provide each JS verification method provided. Trim () property
string.prototype.trim=function () {return
This.replace (/(^\s*) | ( \s*$)/g, "");
Call:
The above is a small set to introduce the JS
To validate a regular expression set of numbers
Verify Number: ^[0-9]*$
Verify the N-bit number: ^\d{n}$
Verify at least n digits: ^\d{n,}$
Verify the number of m-n bits: ^\d{m,n}$
Verify numbers beginning with 0 and non 0: ^ (0|[ 1-9][0-9]*) $
Verify positive real number with two decimal digits: ^[0-9]+ (. [ 0-9]{2})? $
Verify positive real number with 1-3 decimal digits: ^[0-9]+ (. [ 0-9]{1,3})? $
To vali
PHP Common validation Regular expression, PHP regular expression
Number, mobile phone number, QQ number, URL address legality check
1. Verify that it is an integer
1 function isnumber ($val)2 {3 if(ereg $val))4 returntrue; 5 retur
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.