Verify user password: ^ [a-zA-Z] \ w {5, 17} $ the correct format is: it must start with a letter and be between 6 and 18 characters. it can only contain characters, numbers, and underscores.
Verification Number: ^ [0-9] * $
Verify the n-digit number: ^ \ d {n} $
Verify at least n digits: ^ \ d {n,} $
Verify m-n digits: ^ \ d {m, n} $
Verify the number starting with zero or zero: ^ (0 | [1-9] [0-9] *) $
Verify the positive number of two decimal places: ^ [0-9] + (. [0-9] {2 })? $
Verify the positive number of 1-3 decimal places: ^ [0-9] + (. [0-9] {1, 3 })? $
Verify a non-zero positive integer: ^ \ +? [1-9] [0-9] * $
Verify a non-zero negative integer: ^ \-[1-9] [0-9] * $
Verify non-negative integer (positive integer + 0) ^ \ d + $
Verify non-positive integer (negative integer + 0) ^ (-\ d +) | (0 +) $
3 characters for verification: ^. {3} $
Verify A string consisting of 26 English letters: ^ [A-Za-z] + $
Verify a string consisting of 26 uppercase letters: ^ [A-Z] + $
Verify a string consisting of 26 lower-case letters: ^ [a-z] + $
Verify a string consisting of digits and 26 English letters: ^ [A-Za-z0-9] + $
Verify a string consisting of digits, 26 English letters, or underscores: ^ \ w + $
Verify user password: ^ [a-zA-Z] \ w {5, 17} $ the correct format is: it must start with a letter and be between 6 and 18 characters. it can only contain characters, numbers, and underscores.
Check whether ^ % & ',; =? $ \ "And other characters: [^ % & ',; =? $ \ X22] +
Verify Chinese characters: ^ [\ u4e00-\ u9fa5], {0,} $
Verify Email Address: ^ \ w + [-+.] \ w +) * @ \ w + ([-.] \ w + )*\. \ w + ([-.] \ w +) * $
Verify InternetURL: ^ http: // ([\ w-] + \.) + [\ w-] + (/[\ w -./? % & =] *)? $; ^ [A-zA-z] +: // (w + (-w +) *) (. (w + (-w + )*))*(? S *)? $
Verification phone number: ^ (\ d {3, 4} \) | \ d {3, 4 }-)? \ D {7, 8} $: -- the correct format is: XXXX-XXXXXXX, XXXX-XXXXXXXX, XXX-XXXXXXX, XXX-XXXXXXXX, XXXXXXX, 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, 1, 31.
Integer: ^ -? \ D + $
Non-negative floating point number (positive floating point number + 0): ^ \ d + (\. \ d + )? $
Positive floating point number ^ ([0-9] + \. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $
Non-positive floating point number (negative floating point number + 0) ^ (-\ d + (\. \ d + )?) | (0 + (\. 0 + )?)) $
Negative floating point number ^ (-([0-9] + \. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $
Floating point number ^ (-? \ D +) (\. \ d + )? $
×××××××××××××××××××××××××××××××××××××××××
The following are not tested. Please verify and use
1. only numbers and English letters can be entered:
2. only numbers can be entered:
3. only the fullwidth fields can be entered:
4. only Chinese characters can be entered:
5. email address verification:
Var regu = "^ ([0-9a-zA-Z] +) | ([0-9a-zA-Z] + [_. 0-9a-zA-Z-] * [0-9a-zA-Z] +) @ ([a-zA-Z0-9-] + [.]) + ([a-zA-Z] {2} | net | NET | com | COM | gov | GOV | mil | MIL | org | ORG | edu | EDU | int | INT |) $"
Var re = new RegExp (regu );
If (s. search (re )! =-1 ){
Return true;
} Else {
Window. alert ("enter a valid and valid email address! ")
Return false;
}
6. ID card:
"^ \ D {17} (\ d | x) $"
7.17 regular expressions
"^ \ 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 integer
"^ -? \ D + $ "// integer
"^ \ D + ([url = file: //. // d + )? $] \. \ D + )? $ [/Url] "// non-negative floating point number (positive floating point number + 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 + ([url = file: //. // d + )?) % 7C (0 + (//. 0 + )?)) $] \. \ D + )?) | (0 + (\. 0 + )?)) $ [/Url] "// non-positive floating point number (negative floating point number + 0)
"^ (-([0-9] + \\. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $ "// negative floating point number
"^ (-? \ D +) ([url = file: //. // d + )? $] \. \ D + )? $ [/Url] "// floating point number
"^ [A-Za-z] + $" // A string consisting of 26 English letters
"^ [A-Z] + $" // a string consisting of 26 uppercase letters
"^ [A-z] + $" // a string consisting of 26 lowercase letters
"^ [A-Za-z0-9] + $" // string consisting of digits and 26 letters
"^ \ W + $" // a string consisting of a number, 26 English letters, or underscores
"^ [\ W-] + (\\. [\ w-] +) * @ [\ w-] + (\\. [\ w-] +) + $ "// email address
"^ [A-zA-z] +: // (\ w + (-\ w + )*)(\\. (\ w + (-\ w + )*))*(\\? \ S *)? $ "// Url
========================================================== =====
1. the dotted box when the cancel button is pressed
Add the attribute value hideFocus or HideFocus = true in input.
2. read-only text box content
Add the attribute value readonly in input.
3. prevent TEXT files from being cleared (style content can be referenced as a class)
4. press ENTER to move the cursor to the next input box.
5. it can only be Chinese (with flashing)
6. only numbers are allowed (with flashing)
7. only numbers are allowed (no flashing)
8. only English and numbers can be entered (with flashing)
9. shielded input method
10. you can only enter numbers, decimal points, minus (-) characters (no flashing)
11. only two decimal places can be entered, and three decimal places (with flashing)
"^ \ 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 integer
"^ -? \ D + $ "// integer
"^ \ D + ([url = file: // \. \ d + )? $] \. \ D + )? $ [/Url] "// non-negative floating point number (positive floating point number + 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 + ([url = file: // \. \ d + )?) | (0 + (\. 0 + )?)) $] \. \ D + )?) | (0 + (\. 0 + )?)) $ [/Url] "// non-positive floating point number (negative floating point number + 0)
"^ (-([0-9] + \\. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] * \. [0-9] +) | ([0-9] * [1-9] [0-9] *) $ "// negative floating point number
"^ (-? \ D +) ([url = file: // \. \ d + )? $] \. \ D + )? $ [/Url] "// floating point number
"^ [A-Za-z] + $" // A string consisting of 26 English letters
"^ [A-Z] + $" // a string consisting of 26 uppercase letters
"^ [A-z] + $" // a string consisting of 26 lowercase letters
"^ [A-Za-z0-9] + $" // string consisting of digits and 26 letters
"^ \ W + $" // a string consisting of a number, 26 English letters, or underscores
"^ [\ W-] + (\\. [\ w-] +) * @ [\ w-] + (\\. [\ w-] +) + $ "// email address
"^ [A-zA-z] +: // (\ w + (-\ w + )*)(\\. (\ w + (-\ w + )*))*(\\? \ S *)? $ "// Url
"^ (\ D {1, 3} (, \ d {3 })*?) | \ D +) (\. \ d + )? $ // Decimal with commas
Specific use