The user name consists of an alphanumeric underscore of 6-18 digits and cannot be preceded by a number
var r_name=/^[a-z]\w{5,17}$/i
password length cannot be less than six bits
var r_pwd=/^\w{6,}$/
requires the same password input as above
first, determine if the input confirmation password is empty?
if it is not empty, find the object by looking for it . value finds the password in the input box by looking for the object . value to find the values of the confirmation password
compare the two values with = =
if equal, prompt input is correct, otherwise prompt two times password input inconsistent,return False
required to enter the correct email address
[Email protected]
[Email protected]
all General e-mail addresses
var r_eamil=/^\[email protected]\w+ (\.) \w+$/
match a QQ Email address
[Email protected]
var r_qq_email=/^\d{5,} @qq (\.) com$/
match a 163 e-mail address
var r_163_email=/^\[email protected] (\.) com$/
matching a suffix name may be . com|.net|.cn|.edu
var email=/^\[email protected]\w+ (\.) com|net|cn|edu$/
requires a valid age period
var r_age=/^\d{1,2}$/
if (age>=18&&age<=100)
Verify phone number : one digit
18
13
15
var r_tel=/^1[3,5,8]\d{9}$/
Verify that the ID number is in the same position or a X
var r_s=/^\d{18}|\d{17}x$/i
Verify Chinese
var reg=/^[\u4e00-\u9fa5]{2,17}$/
if (Reg.test (" Guo Yunpeng ")) {
Alert ("OK")
}else{
Alert ("No")
}
Verify IP 192.168.1.250
var r_ip=/^\d{3} (\.) \d{1,3} (\.) \d{1,3} (\.) [2-9] {1,3}$/
Verify URL
Www.baidu.com
www.taobao.cn
Www.sina.net Www.baiwei.
var r_web=/^www (\.) \w+ (\.) \w+$/i
Verify the landline number 010-62279965 0377-62258080 020-
var r_tel=/^0\d+-\d+$/
ID Card Verification
/^ ((\d{15}) | (\d{17}[0-9x])) $/
Mailbox Verification
/^\[email protected]\w+ (\.\w+) +$/;
Validates a string consisting of an English letter
/^[a-za-z]+$/
Validates a string consisting of the letters of the four capitals:
/^[a-z]+$/
Validates a string consisting of the four lowercase English letters:
/^[a-z]+$/
Validates a string consisting of a number and an English letter:
/^[a-za-z0-9]+$/
Validates a string consisting of a number, an English letter, or an underscore:
/^\w+$/
Verify User name:
/^[a-za-z]\w{5,7}$/"Number can not start, users include 6 to 8 bits"
To verify the user password :
/^[a-za-z]\w{5,17}$/ Correct format: Start with a letter, length between 6-18 , can contain only characters, numbers, and underscores.
Validating kanji: Verifying Chinese characters:
/^[\u4e00-\u9fa5]+$/
Domestic Landline:
/^\d{3}-\d{8}|\d{4}-\d{7}$/
Mailbox
/^ ([a-za-z0-9_-]) [email protected] ([a-za-z0-9_-]) + (. [ A-za-z0-9_-]) +/;
Cell phone:
/^ ((13[0-9]{1}) |159|153) +\d{8}$/
/^ (13+\d{9}) | (159+\d{8}) | (153+\d{8}) $/
The regular artifact