JS to verify the real name, is to use the Unicode character to match, and the Chinese name length is generally 2-4, so repeat the match {2,4} times
1.js Verify real name
1 varRegname =/^[\u4e00-\u9fa5]{2,4}$/; 2 if(!regname.test (name)) { 3Alert (' real name is wrong '); 4 return false; 5}
JS Authentication ID number, China's ID number, a generation of identity card number is 15 digits, the second-generation ID card is 18-bit, the last check digit in addition to may be the number may also be ' x ' or ' x ', so there are four possibilities: a.15 bit number b.18 digit c.17 digit, 18th bit is ' X ' d.17 digits, the 18th digit is ' x '
2.js Authentication ID Number
1 varRegidno =/(^\d{15}$) | (^\d{18}$) | (^\d{17} (\d| X|X) $)/; 2 if(!regidno.test (Idno)) { 3Alert (' ID number is incorrect '); 4 return false; 5}
Reference link:http://www.cnblogs.com/songhaipeng/archive/2012/12/27/2835030.html
JS authentication name and ID number