Only numbers are allowed: "^ [0-9] * $ ".
Only n digits can be entered: "^ d {n} $ ".
You can only enter at least n digits: "^ d {n,} $ ".
Only m ~ can be input ~ N-digit :. "^ D {m, n} $"
Only numbers starting with zero and non-zero can be entered: "^ (0 | [1-9] [0-9] *) $ ".
Only positive numbers with two decimal places can be entered: "^ [0-9] + (. [0-9] {2 })? $ ".
Only 1 ~ Positive number of three decimal places: "^ [0-9] + (. [0-9] {1, 3 })? $ ".
Only a non-zero positive integer can be entered: "^ +? [1-9] [0-9] * $ ".
Only a non-zero negative integer can be entered: "^-[1-9] [] 0-9" * $.
Only 3 characters can be entered: "^. {3} $ ".
You can only enter A string consisting of 26 English letters: "^ [A-Za-z] + $ ".
You can only enter a string consisting of 26 uppercase letters: "^ [A-Z] + $ ".
You can only enter a string consisting of 26 lower-case English letters: "^ [a-z] + $ ".
You can only enter a string consisting of a number and 26 English letters: "^ [A-Za-z0-9] + $ ".
You can only enter a string consisting of digits, 26 English letters, or underscores (_): "^ w + $ ".
Verify User Password: "^ [a-zA-Z] w {5, 17} $" correct format: Start with a letter, Length: 6 ~ It can only contain characters, numbers, and underscores.
Check whether ^ % & ',; =? $ "And other characters:" [^ % & ',; =? $ X22] + ".
Only Chinese characters can be entered: "^ [u4e00-u9fa5] {0,} $ ".
Verify Email address: "^ w + ([-+.] w +) * @ w + ([-.] w + )*. w + ([-.] w +) * $ ".
Verify InternetURL: "^ http: // ([w-] +.) + [w-] + (/[w -./? % & =] *)? $ ".
Verification phone number: "^ (d {3, 4}-) | d {3.4 }-)? D {7,8} $ "correct format:" XXX-XXXXXXX "," XXXX-XXXXXXXX "," XXX-XXXXXXX "," XXX-XXXXXXXX "," XXXXXXX "and" XXXXXXXX ".
Verify the ID card number (15 or 18 digits): "^ d {15} | d {18} $ ".
12 months of verification: "^ (0? [1-9] | 1 [0-2]) $ "the correct format is:" 01 "~ "09" and "1 "~ "12 ".
31 days of verification for a month: "^ (0? [1-9]) | (1 | 2) [0-9]) | 30 | 31) $ "the correct format is;" 01 "~ "09" and "1 "~ "31 ".
Use regular expressions to restrict text box input in a webpage form:
You can only enter Chinese characters using regular expressions: onkeyup = "value = value. replace (/[^ u4E00-u9FA5]/g, '')" onbeforepaste = "clipboardData. setData ('text', clipboardData. getData ('text '). replace (/[^ u4E00-u9FA5]/g ,''))"
You can only enter the full-width characters: onkeyup = "value = value. replace (/[^ uFF00-uFFFF]/g, '')" onbeforepaste = "clipboardData. setData ('text', clipboardData. getData ('text '). replace (/[^ uFF00-uFFFF]/g ,''))"
Use a regular expression to limit that only numbers can be entered: onkeyup = "value = value. replace (/[^ d]/g, '')" onbeforepaste = "clipboardData. setData ('text', clipboardData. getData ('text '). replace (/[^ d]/g ,''))"
You can only enter numbers and English letters using regular expressions: onkeyup = "value = value. replace (/[W]/g,
<