Verify the individual capital letters have regular expressions and other writing regular expressions

if (!/^[A-Z]{0,1}$/.test(linecode)){
			top.messageShow("线路编号只能为单个大写字母!","提示!");
			return false;
		} 
		

E-mail verification

function SubmitCk() {
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if (!reg.test($("#txtEmail").val())) {
alert("请输入正确邮箱地址")
return false;
}
}

Other regular expression:

Regular expression to verify the digital set 
validation numbers: ^ [0-9] * $ 
verification bit number n: ^ \ d {n} $ 
verification least n bit digital: ^ \ d {n,}  $
verifies the digital bit mn : ^ \ 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})?] + $ 
verify that there is a positive real number 1-3 digit decimal: (. [0-9] {1,3})? ^ [0-9] + $ 
verification non ? positive integer zero: ^ \ + [1-9] [0-9] * $ 
verification of non-zero-negative integers: ^ \ - [1-9] [0-9] * $ 
verification of non-negative integers (positive integer + 0) ^ \ d + $ 
verification non-positive integer (negative integer + 0) ^ ((- \  d +) | (0 +)) $
verification character of length 3 of: ^ {3} $. 
verified by the 26 letters of the alphabet string consisting of: ^ [a-Za-z  ] + $
authentication string 26 by a capital English letters: ^ [AZ] + $ 
authentication string 26 by the small letters written consisting of: ^ [az] + $ 
verification string of numbers and English letters 26: ^ [a-Za-z0-9  ] + $
authentication string of digits, letters or underscore 26 consisting of: ^ \ 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 that contain ^% & '?,; = $ \ "And other characters: [^% &',;  = $ \ x22?] +
Verify Character: ^ [\ u4e00- \ u9fa5]  , {0,} $
verify Email Address: / ^ ([a-zA -Z0-9] + [_ | \ _ | \.]?) * [A-zA -Z0-9] + @ ([a- zA-Z0-9] + [_ | \ _ |.? \]). * [a-zA-Z0-9] + \ [a-zA-Z] { 2,3} $ /
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} $:? - The 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 blog.csdn.net/qq_40216244/article/details/83097787