Current location - Quotes Website - Signature design - Urgent! How to write the name of asp.net(VB) periodic verification?
Urgent! How to write the name of asp.net(VB) periodic verification?
[\u4e00-\u9fa5]{2,4}

Unicode4e00 to 9fa5 are all Chinese characters, repeated 2 to 4 times.

Here are some common matches:

Match double-byte characters (including Chinese characters): [\ x00-\ xff]

Note: It can be used to calculate the length of a string (a double-byte character length of m 2, ASCII character of m 1).

Regular expression matching blank lines: \n\s*\r

Note: It can be used to delete blank lines.

Regular expressions that match HTML tags:

Comments: The version circulating on the Internet is so bad that the one above can only match the part, but it is still helpless for the complex nested tags.

Regular expression matching leading and trailing white space characters: \ s * | \ s * $

Note: It can be used to delete blank characters (including spaces, tabs, page breaks, etc. ) at the beginning and end of a line. This is a very useful expression.

Regular expression matching email address: \ w+([-+. ] \ w+) * @ \ w+([-。 ] \ w+) * \。 \ w+([-。 ] \ w+) *

Comments: Form verification is very practical.

Regular expression matching URL: [a-za-z]+://[\ s] *

Comments: The functions of the versions circulating on the Internet are very limited, and the above versions can basically meet the needs.

Whether the matching account is legal (5- 16 bytes are allowed at the beginning of the letter, and alphanumeric underline is allowed): [a-za-z] [a-za-z0-9 _] {4, 15} $

Comments: Form verification is very practical.

Match domestic phone numbers: \d{3}-\d{8}|\d{4}-\d{7}

Note: the matching form is 05 1 1-4405222 or 02 1-8788822.

Match Tencent QQ number: [1-9][0-9]{4,}

Comments: Tencent QQ number 10000.

Match the postal code of China: [1-9]\d{5} (? ! \d)

Remarks: The postcode of China is 6 digits.

Matching ID: \d{ 15}|\d{ 18}

Comments: China's ID card has 15 digits or 18 digits.

Matching ip address: \d+\. \d+\。 \d+\。 \d+

Note: useful when extracting ip address.

Match a specific number:

[1-9]\ d * $// matches a positive integer.

-[ 1-9]\ d * $// Matches a negative integer

^-? [1-9]\d*$ // matches an integer.

[1-9]\ d * | 0 $// Matches a non-negative integer (positive integer +0).

-[ 1-9]\ d * | 0 $// matches a non-positive integer (negative integer +0).

[ 1-9] \ d * \。 \ d * | 0 \。 \ d *[ 1-9]\ d * $/ matches a positive floating point number.

-([ 1-9] \ d * \。 \ d * | 0 \。 \ d *[ 1-9]\ d *)$// matches a negative floating-point number.

^-? ([ 1-9]\d*\。 \d*|0\。 \d*[ 1-9]\d*|0? \.0+|0)$ // Matches a floating point number.

^[ 1-9]\d*\.\d*|0\。 \d*[ 1-9]\d*|0? \.0+|0$ // Matches a non-negative floating point number (positive floating point number +0).

^(-([ 1-9]\d*\.\d*|0\。 \ d *[ 1-9]\ d *)| 0? \.0+|0$ // Matches a non-positive floating-point number (negative floating-point number +0)

Comments: It is useful when dealing with a large amount of data, and should be corrected in specific applications.

Match a specific string:

[A-ZA-Z]+$// Matches a string consisting of 26 English letters.

[A-Z]+$// Matches a string consisting of 26 uppercase English letters.

[A-Z]+$// Matches a string of 26 lowercase letters.

[A-ZA-Z0-9]+$// Matches a string consisting of numbers and 26 English letters.

\ w+$// Matches a string consisting of numbers, 26 English letters or underscores.

Comments: Some of the most basic and commonly used expressions