17 Frequently Used Regular Expressions

xiaoxiao2021-03-06  78

"^ / D $" // Non-negative integer (positive integer 0)

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

"^ ((- / d ) | (0 )) $" // Non-positive integer (negative integer 0)

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

"^ -? / d $" // integer

"^ / D (/. / D )? $" // Non-looted number (positive floating point 0)

"^ (([0-9] /. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * / [0-9] ) | ([0-9] * [1-9] [0-9] *)) $ "// Positive floating point number

"^ (((((- / D (/ d )?) | (0 (/. 0 )?)) $" // Non-positively floating point number (12 0)

"^ (((((((((([0-9] /. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * /. [0-9] ) | ([0-9] * [1-9] [0-9] *))) $ "// loaded point number

"^ (-? / d ) (/. / d )? $" // floating point number

"^ [A-ZA-Z] $" // String consisting of 26 English letters

"^ [A-Z] $" // String consisting of 26 English letters

"^ [A-Z] $" // String consisting of 26 English letters

"^ [A-ZA-Z0-9] $" // String consisting of numbers and 26 English letters

"^ / w $" // String composed of numbers, 26 English letters or underlined

"^ [/ w -] (/. [/ w -] ) * @ [/ w -] (/. [/ w -] ) $" // email address

"^ [A-ZA-Z] : / / (/ w / w ) *) (/. (/ w / w ) *) * (/? / s *)? $" // URL

转载请注明原文地址:https://www.9cbs.com/read-121766.html

New Post(0)