" (equivalent to "a|b");
[A-d]: Indicates that a string contains one of the lowercase ' a ' to ' d ' (equivalent to "a|b|c|d" or "[ABCD]");
"^[a-za-z]": Represents a string that begins with a letter;
"[0-9]a": Indicates a digit before A;
[a-za-z0-9]$: Indicates that a string ends with a letter or a number.
“.” Match any single character except "\ r \ n":
"A.[a-z]": Indicates that a string has a "a" fo
The correct format for the message is: User name +@+ server name +. +com/net/cn/orgNote: 1, verify that the user name is the size of letters or lowercase letters2, after the user name to add @3, after the @ To add the name of the server.4, after the service name to add "point" that is.5, finally to COM net cn org
JavaScript Mailbox Authentication Code:
Example 1
The code is as follows
Copy Code
var re=/^ ([a-za-z0-9]+[_|
Here can be used to 2 kinds of methods, one is to use Preg_match to verify, one is to use JS to judge.
First, the PHP method
The code is as follows
Copy Code
Preg_match ("/^[0-9a-za-z]+@" ([0-9a-za-z]+) [.]) +[a-z]{2,4}$/i ", $email);
How to use:
The code is as follows
Copy Code
fun
"[]". where [Required] is one of the validation tags, [display], [DataType] is to display the corresponding HTML control, which is outside the scope of this article.In addition to required, we can add other useful validation tags to the model. The following is a more complete list:Model the validation tokens that can be added in a class:1. Required Fields[Required]public string FirstName {get; set;}2. field LengthUp to n bits:[Stringlength (160)]public string FirstName {get; set;}Requires at le
characters );
Square brackets indicate that certain characters can appear at a specific position in a string:
"[AB]": indicates that a string has a "a" or "B" (equivalent to "a between B ");
"[A-d]": indicates that a string contains one of the lower-case 'A' to 'D' (equivalent to "a character B character c character d" or "[abcd]");
"^ [A-zA-Z]": a string that starts with a letter;
"[0-9] %": indicates a digit before the percent sign;
", [A-
other blank characters), SO \ s + indicates at least one space, for example, matching '','', etc;
3.\d{3,8}3-8 digits, for example, '20140901 '.
In combination, the above regular expression can match a telephone number with a zone number separated by any space.
What if I want to match a number like '010-12345? Because '-' is a special character, it must be escaped using '\' in a regular expression. Therefore, the above regular expression is \ d {3} \-\ d {3 }.
However, it still cannot match '01
id;Bool operator {Return x }Bool operator = (const zs a) const{Return x = a. x;}} Zx;Struct zz{Int x;Int id;Bool operator {Return id> a. id;}Bool operator = (const zz a) const{Return id = a. id;}} Za;Int n, m;Int a [maxn];Map Set Set Set Set Set Int main (){While (cin> n> m){Mp. clear ();For (int I = 1; I {Mp [I]. insert (inf ++ );}For (int I = 1; I {Cin> a [I];Mp [a [I]. insert (I );Mp [a [I]. insert (inf ++ );}S. clear ();Sa. clear ();For (int I
required, we can also add other valid validation identification memento flags in the model. The following is a more complete list:Model The memento flag that can be added to the class in the validation ID:1. Required Fields[Required]public string FirstName {get; set;}2. Field lengthUp to n bits:[Stringlength (160)]public string FirstName {get; set;}Request at least n bits:[Stringlength (Minimumlength=3)]public string FirstName {get; set;}3. Regular validation[RegularExpression (@ "[a-
Nginx location regular match Problem reply discussion (solution)
Rewrite ^/([A-D]) ([a-zA-Z0-9] {10 })/? $/Index. php? A = $1 B = $2 last;
Rewrite ^/([A-D]) ([a-zA-Z0-9] {10 })/? $/Index. php? A = $1 B = $2 last;
It is matched in location and matched to forward
The following error is reported and cannot be started.
location ^/([A-D])([a-zA-Z0-9]{10})/
string.You can also use ranges, enclosed in curly braces, to represent the range of repetitions."Ab{2}": Indicates that a string has a followed by 2 B ("ABB");"Ab{2,}": Indicates that a string has a followed by at least 2 b;"ab{3,5}": A string that has a followed by 3 to 5 B.' * ', ' + ' and '? ' Equivalent to "{0,}", "{1,}" and "{0,1}"' ¦ ', means "or" Operation:"Hi¦hello": Indicates a string with "hi" or "Hello","(B¦CD) EF": "bef" or "cdef";"(A¦b) *c": A string of "a" "B" mixed strings follow
Reply to discussion (solution)
Rewrite ^/([a-d]) ([a-za-z0-9]{10})/?$/index.php?a=$1b=$2 last;
Rewrite ^/([a-d]) ([a-za-z0-9]{10})/?$/index.php?a=$1b=$2 last;
is in the location match, matching to do the forwarding
The following error, can not start
Location ^/([a-d]) ([a-za-z0-9]{10})/?$ {proxy_pass http://127.0.0.1:88/;p roxy_redirect off;proxy_set_he
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 following rule expression ereg (^ [a-zA-Z0-9 _] @ [a-zA-Z0-9 \-] \. [a-zA-Z0-9 \-\.] $], $ email); however, the sub-function above can only check strings,
When you register on a forum, there is u
Why? The following parameters are not included in the url. I don't know why nbsp; the original urlPHPcodeRewriteRule ^ mall (? :( [A-zA-Z0-9] + )(? :-([A-zA-Z0-9] + )(? :-([Ask an apache rewrite rule question
A few days ago, I wrote a new url rule like a url rule, but I matched it with. html? The following parameters are not included in the url. why?
Original url
PHP code
RewriteRule ^/mall(?:\/([a
; Set ;} }
Compared with the common C # class, we find that each attribute has a tag enclosed by square brackets. [Required] is a type of verification tag, while [display] and [datatype] are used to display the corresponding HTML control, which is not covered in this article.
In addition to required, we can also add other useful verification tags to the model. The following is a complete list:
ModelVerification tags that can be added to the class:
1.Required field
[Required]
Tag: contains the successfully matched span data exchange proc length [] com
1 Regular ExpressionImport re# [] Use-for connection during range matching# Re. findall ("[a-zA-Z0-9]", "a AB ABC ABCD a123c ")# If you want to match the symbol-the left or right side of the expression to be written# Print (Re. findall ("[-AB]", "a AB ABC ABCD a123c --"))
# Number of times of repeated matching expressions# * Indicates any number of times. Therefore, the value
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.