Common set of regular expressions


Verify Digital: ^ [0-9] * $ 
verification bit number n: ^ \ d {n} $ 
verification least n bit digital: ^ \ d {n,}  $
verifies the digital mn bits: ^ \ d {m, n} $ 
verification zero and non-zero number at the beginning: ^ (0 | [1-9]  [0-9] *) $
verify that there are two positive real number of decimal places: ^ [0-9] + ([0-. ? 9] {2}) $ 
verification has a positive real number bits 1-3 decimal: ^ [0-9] + ([0-9] {1,3}) $.? 
verify nonzero positive integer: ^ \ ? + [1-9] [0-9] * $ 
verification negative integer zero: ^ \ - [1-9] [0-9] * $ 
verification non-negative integer (integer + 0) ^ \ d + $ 
verification of non-positive integer (negative integer + 0) ^ ((- \  d +) | (0 +)) $
verification character of length 3 of: ^ {3} $. 
verification string consisting of the 26 English letters: ^ [ a-Za-z] + $ 
authentication string 26 by a capital English letters: ^ [AZ] + $ 
authentication string 26 by the small letters written consisting of: ^ [az] + $ 
verified by digital and 26 string consisting of letters: ^ [a-Za-z0-9  ] + $
verified by a digital, 26 English letters or underscore character strings: ^ \ w + $ 
validate user passwords: ^ [a-zA-Z ] \ w {5,17} $ correct format: beginning with the letter, the length between 6-18, can contain characters, numbers and underscores. 
Verify ^% & containing '?,; $ = \ "Characters such as: [^% &',;  = $ \ x22?] +
Verify Character: ^ [\ u4e00- \ u9fa5]  , {0,} $
Verify Email Address:. ^ \ W + [-  . +] \ W +) * @ \ w + ([-.] \ W +) * \ \ w + ([-.] \ W +) * $
verification InternetURL: ^ http: // (. [\ w -] + \) + [\ w -] + (/ [\ w-./?%&=]*)?$; ^ [a-zA-z] +: // (w + ( ?? -w +) *) (  . (w + (- w +) *)) * (S *) $
verify the phone number: ^ (\ (\ d { 3,4} \) | \ d {3,4} - ) \ d {7,8} $: -? correct format is: XXXX-XXXXXXX, XXXX-XXXXXXXX  , XXX-XXXXXXX, XXX-XXXXXXXX, XXXXXXX, XXXXXXXX.
ID card verification number (15 or 18 digits): ^ \ d {15}  | \ d {} 18 $
verify year 12 months:? ^ (0 [1-9] | 1 [0-2] ) $ correct format: "01" - "09" and "1" "12" 
verify a month 31 days: ^ (? (0 [1-9 ]) | ((1 | 2) [0-9] ) | 30 | 31) $ format is correct: 01,09 and 1,31. 
Integer:? ^ - \ d + $ 
non-negative floating-point numbers (positive float + 0): ^ \ d +  (\ \ d +.) $?
Positive float ^ (([0-9] + \ [0-9]. * [1-9] [0-9] * ) | ([0-9] * [1-9] [0-9] * \ [0-9] +) |. ([0-9] * [ 1-9] [0-9] *)) $ 
non-positive float (negative float + 0) ^ ((- \ d + (\ \ d +.)) | (0 + (\ 0+.))?? ) $ 
negative float ^ (- (([0-9] + \ [0-9] * [1-9] [0-9] *) |. ([0-9] * [1-9] [ 0-9] * \ [0-9] +  ) |. ([0-9] * [1-9] [0-9] *))) $
Float ^ (-? \ D +) (. \ \ D +) $?

Guess you like

Origin www.cnblogs.com/ww93/p/10966991.html