Common Regular Expressions

"^ \ D + $" / / non-negative integers (positive integer + 0)

"^ [0-9] * [1-9] [0-9] * $" / / a positive integer

"^((- \ D +) | (0 +))$" / / non-positive integer (negative integer + 0)

"^ - [0-9] * [1-9] [0-9] * $" / / negative integer

"^ -? \ D + $" / / integer

"^ \ D + (\. \ D +)?$" / / non-negative floating-point (positive float + 0)

"^(([ 0-9] + \. [0-9] * [1-9] [0-9 ]*)|([ 0-9] * [1-9] [0-9] * \ . [0-9 ]+)|([ 0-9] * [1-9] [0-9 ]*))$" / / are floating point

"^((- \ D + (\. \ D +)?)|( 0 + (\ .0 +)?))$" / / non-positive floating-point (negative float + 0)

"^(-(([ 0-9] + \. [0-9] * [1-9] [0-9 ]*)|([ 0-9] * [1-9] [0-9] * \. [0-9 ]+)|([ 0-9] * [1-9] [0-9 ]*)))$" / / negative float

"^(-? \ D +) (\. \ D +)?$" / / float

"^ [A-Za-z] + $" / / by the 26 English letters in the string

"^ [AZ] + $" / / by the 26 English letters Uppercase a string

"^ [Az] + $" / / by the 26 English letters in lower case string of

"^ [A-Za-z0-9] + $" / / by the numbers and 26 English-letter string

"^ \ W + $" / / by the numbers, 26 English letters or underscore a string

"^ [\ W-] + (\. [\ W-]+)*@[ \ w-] + (\. [\ W-]+)+$" or w +([-+.] w +) * @ w +([-.] w +) *. w +([-.] w +) * "/ / email address
"^ [A-zA-z ]+://( \ w + (- \ w +)*)( \. (\ W + (- \ w +)*))*( \? \ S *)?$" / / url

"((D (3,4)) | d (3,4) -)? D (7,8) (-d (3)) *" / / China's phone number validation
If :0511-match form or 021-44055520-555 or 4405222 or 021-87888822 (0511) 4,405,222

"D (6)" / / China Postal Code authentication
Match forms such as: 215 421

"D (18) | d (15)" / / ID verification
Matching forms, such as: 15 or 18 identity

[^<>&/|' \] + / / Illegal character verification
Match illegal characters such as: <> & / '|
Regular Expressions

((((19) (1) | (20) (1)) d (2)) | d (2)) [01] (1) d (1) [0-3] (1) d (1) / / Date validation
Match forms such as: 20030718,030718

Declined comment