Learn about regular expression for email validation, we have the largest and most updated regular expression for email validation information on alibabacloud.com
Regular expression is regular expression, it seems that English is better than Chinese understand more, is to check expression characters
Not meet the rules!! Regular expressions have a very powerful and very complex object regexp
PHP email Email/^[a-z] ([a-z0-9]*[-_]?[ a-z0-9]+) *@ ([a-z0-9]*[-_]?[ a-z0-9]+) +[\.] [A-z] {2,3} ([\.] [A-z] {2})? $/i;/i form a case-insensitive regular expression; ^ match start $ match end * represents 0 or more. + represents 1 or more.? Represents 0 or 1. [A-z] The e-mail prefix must be preceded by an English lett
python Regular Expressionsis a special sequence of characters that can help you conveniently check whether a string matches a pattern, and this article will
python Regular ExpressionTell you
Regular ExpressionsThere is a lot of use in Python because he can make arbitrary matches that match the information we want to extract. When we touch
Python regularYou will k
($. trim ($ ('# name '). val () = false) {str + = 'invalid name \ n'; $ ('# name '). focus () ;}/// determine the mobile phone number if ($. trim ($ ('# phone '). val ()). length = 0) {str + = 'mobile phone no. \ n'; $ ('# phone '). focus ();} else {if (isPhoneNo ($. trim ($ ('# phone '). val () = false) {str + = 'incorrect mobile phone number \ n'; $ ('# phone '). focus () ;}// verify the ID card if ($. trim ($ ('# identity '). Val ()). length = 0) {str + = 'id card number is not entered \ n';
{return false;} elseif (20
Two or more letters, numbers, or underscores: ^ [A-zA-Z0-9 _ \ x7f-\ xff] [a-zA-Z0-9 _ \ x7f-\ xff] + $.
Note: Here the letter is a-z, A-Z, and ASCII characters from 127 to 255 (0x7f-0xff)
2. password:It consists of 6 to 20 digits and consists of letters and numbers. the code is as follows:
function isPWD($value,$minLen=5,$maxLen=16){ $match='/^[\\~!@#$%^*()-_=+|{}\[\],.?\/:;\'\"\d\w]{'.$minLen.','.$maxLen.'}$/'; $v = trim($value); if(emptyempty($v)) return false; re
]{2} (0[48]|[ 2468][048]| [13579] [26])
2: Hundred years does not leap, 400 year again leap(0[48]| [2468] [048]| [13579] [26]) 00
3: Together is the February 29 of all leap years([0-9]{2} (0[48]|[ 2468][048]| [13579] [26]) | (0[48]| [2468] [048]| [13579] [26]) 00)-02-29)
All four rules are implemented and have no effect on each other, and together is the regular of all dates that match the DateTime range
^((?! 0000) [0-9]{4}-(0[1-9]|1[0-2])-(0[1-9
Detailed explanation of Regular Expression Form Verification examples, detailed explanation of Regular Expression Form
Let's take a look:
First, I want to explain some symbolic meanings to you.
* Matches the previous subexpression zero or multiple times;^ Match the start position of the input string; $ match the end p
object is returned. If the match fails, None is returned. The group () method of the matching object can be used to display the successful match.
1 html = '14 # ('title', '123 ')
>>> re.match('foo', 'food on the table').group() 'foo' 4. Use search () to search for a string)
The search () method is exactly the same as match,The difference is that search () uses its string parameters.To search for the first matching condition for the given regular
Regular expression is regular expression, it seems that English is better than Chinese understand more, is to check expression characters
Not meet the rules!! Regular expressions have a very powerful and very complex object regexp
Author: A Lai (Email: A at lai.com.cn homepage: http://www.9499.net blog: http://blog.csdn.net/laily)
Keywords: Regular Expression VB VBScript Javascript
Abstract: The conversion from a JavaScript regular expression to a VBScript regular
the next version of the email address check function? The second function shown above uses only regular expressions, including a call to the Ereg function. The Ereg function returns TRUE or FALSE to declare whether its string argument matches the regular expression. Many programmers avoid
name is the same, but to remove the underline:
^[a-z0-9-]+ (\.[ a-z0-9-]+) *$
Good. Now just use the "@" to connect the two parts:
^[_a-z0-9-]+ (\.[ _a-z0-9-]+) *@[a-z0-9-]+ (\.[ a-z0-9-]+) *$
This is the complete email authentication matching mode, only need to call:
Eregi ("^[_a-z0-9-]+" (\.[ _a-z0-9-]+) *@[a-z0-9-]+ (\.[ a-z0-9-]+) *$ ", $eamil)
We can get an email.
Other uses of
The regular expression is not a programming language, and there is no function of computing and dealing with problems, it is a single string that describes or matches a series of strings that conform to a certain syntactic rule.Examples of regular expression applications:
Prevent SQL injection: Especially for
This regular expression that matches the URL address is a regular expression that we specifically write to filter the external URL address in the post to match all URL addresses. is a strong regular expression that passes through
When programmers write code without having to deal with strings and "queries," There is a thing called regular expression in the intersection of the two, and this guy can improve programming efficiency with bad words ... You can go and learn a lesson first.
For a simple example of regular use:
Copy Code code as follows:
var m = Location.href.mat
The regular expressions currently used are as follows:
Copy Code code as follows:
(? =.*\d) (? =.*[a-za-z]) (? =.*[^a-za-z0-9]). {8,30}
The corresponding validation rule is that the password must contain letters, numbers, special characters, at least 8 characters, and a maximum of 30 characters.
This regular
backslash (). The escape sequence for tabs is: T. So if we're going to detect whether a string starts with tabs, you can use this pattern:
^t
Similarly, a "new row" is represented by N, and R represents a carriage return. Other special symbols, which can be preceded by a backslash, such as the backslash itself with the expression, the period.
2. Character clusters
In programs on the Internet, regular e
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.