Learn about regular expression for email validation, we have the largest and most updated regular expression for email validation information on alibabacloud.com
Have a friend complete a number of JS and jquery numeric type validation regular expression code, below I give you to tidy up here, including the implementation of digital verification and test examples, we can refer to. JS validation number regular
From: http://www.cnblogs.com/Dannier/archive/2010/11/06/RegExp.html
Email Verification
A regular expression (often abbreviated as Regexp) is a mode written with special symbols to describe one or more text strings. The regular expression is used to match the text pattern,
RegularExpressionValidator has two main properties for validation. The controltovalidate contains a value for validation. such as removing the value from the text box. such as controltovalidate= "TextBox1" validationexpression contains a regular expression for validation.
We
;. Format ( "{0:0000}" ,i) + "\ n" ;
}
}NBSP;NBSP;
for (int i = 1; i
{
if ((i% 4 = = 0 i%! = 0) | | I% 400 = = 0)
{
Richtextbox2.text + = string. Format ("{0:0000}", i) + "\ n";
}
}
According to the rules of leap year, it is easy to sort out rules, four years a leap;([0-9]{2} (0[48]|[ 2468][048]| [13579] [26])century does not leap, 400 years again leap .(0[48]| [2468] [048]| [13579] [26]) 00Together is the February 29 of all leap years([
General email, form such as zhangshan@163.com,abc@sina.com.cn some commonly used forms on the line, but in our company some customers in the mailbox but there are some zhangshna. Mr@163.com,abc_wang.dd@sian.com,abc_wang.dd.cc@sian.com this similar form, before the @ symbol is a little., the original is to use, but not now, have to study the use of the regular
Friends, if there is a
if (Eregi (^[_.0-9a-z-]+@) ([0-9a-z][0-9a-z-]+.) +[a-z]$ ", $email)) {
echo "Your e-mail through preliminary check";
}
?>
In this sentence, the first is to apply a eregi function, this function is very good understanding. Find a book and give you an explanation:
Syntax: int ereg (string pattern, string string, array [regs]);
return value: Integer/array
This function resolves string strings using pattern rules.
The value returned by the result is pla
to decide whether a whole string of strings matches is an assertion. such as ^ $
The code is as follows
Copy Code
/^ ([w._]{2,10}) @ (W{1,}). ([a-z]{2,4}) $/
Note the head and tail plus ^ $
The code is as follows
Copy Code
$a = '/^ ([w._]{2,10}) @ (W{1,}). ([a-z]{2,4}) $/';$b = ' 1412424545645454545454545k@qq.com ';if (Preg_match ($a, $b)) {echo "e-mail Legal";}else{echo "e-mail is illegal";}
Okay, I'm going to do a
In the development of the registration system, the need to detect the user input email address is legitimate, can use regular expression to detect, below a small example, I hope to help youIn the registration system development, the need to detect the user input email address is legitimate, can be detected in JS or PHP
PHP Mailbox Validation Regular expression
The code is as follows
Copy Code
Preg_match ("/^[0-9a-za-z]+@" ([0-9a-za-z]+) [.]) +[a-z]{2,4}$/i ", $email);
Example of a PHP mailbox validation regular
Match the regular expression of the email address in php. A php regular expression matching mailbox address instance, mail address replace regular I commonly used regular
Regular expressions are often used to validate various forms, Java forms register common Regular Expression validation tool classes, and common regular expression large collections.
1. Telephone number
2. zip Code
3. QQ
4. E-M
Java e-commerce common regular expression mobile phone number email ID verification code, etc.Package cn.java.com;Import Java.util.regex.Pattern;/*** Account-related attribute verification tool**/public class Verifyutil {/*** Regular expression: Verify user name*/public stat
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
number, if the same, the explanation passed, otherwise it is invalid ID number if(Idcardlast = =Idcardy[idcardmod]) {Alert ("Congratulations passed the verification!" "); } Else{alert ("Wrong ID number!" "); } } } } Else{alert ("ID card format is incorrect!"); }}/** can only be a positive integer*/varRegNum =/^\d+$/;/** ZIP Code*/varRegpostcode =/^\d{6}$/;/** User name * can only be alphanumeric underline, and start with a letter (5-16 bit)*/varRegusername =/
-]" indicates that it is included in "_", ". ","-", letters from a to z, any characters in numbers from 0 to 9;In this way, the regular expression can be translated as follows:The following characters must start with (^), "_", and ". ","-", letters from a to z, numbers from 0 to 9 ([_. 0-9a-z-] "," the preceding character must appear at least once (+) ", @," the string starts with a character that contains
This article mainly introduces php mail address Regular Expression verification. The php language is used to implement the e-mail address verification program, which uses the php Regular Expression Library, for more information, see
This article mainly introduces php mail address R
The previous article simply wrote a regular expression of theoretical knowledge, this is the actual combat verificationFirst we write a URL validation class, of course, it can be another environment, here we have the Java environmentPackage Com.zyt.regex;Import Java.util.regex.Matcher;Import Java.util.regex.Pattern;URL validationpublic class Urlreg {public String
r_eamil=/^\w+@\w+ (\.) \w+$/
Match a QQ email address
861745122@qq.comvar r_qq_email=/^\d{5,} @qq (\.) com$/
Match a 163 email address var r_163_email=/^\w+@163 (\.) com$/ Matching a suffix name may be. com|.net|.cn|.edu var email=/^\w+@\w+ (\.) com|net|cn|edu$/ Required to enter a valid age section var r_age=/^\d{1,2}$/ if (age>=18age "=100") Verify mobile p
An instance of a regular expression that matches the email address in PHP, and the email address replaces the regular matching expression I used most often:/^[a-z] ([a-z0-9]*[-_]?[ a-z0-9]+) *@ ([a-z0-9]*[-_]?[ a-z0-9]+) +[\\.] [A
); // associate the regular expression with the string to match the string.
2. Cut: The split method in the string class is used.
3. Replace: replaceall () in the string class ();
4. obtain:
1), first compile the regular expression into a regular object. The static me
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.