Digital Judgment Method: isNaN () function
The test () method determines whether the string matches the contents of the regular expression, and returns a Boolean value (True/false)
Verify that the Chinese name
function ischinaname (name)
{var pattern =/^[\u4e00-\u9fa5]{1,6}$/;
return pattern.test (name);
//Verify the mobile number
function Isphoneno (phone) {
var pattern =/^1[34578]\d{9}$/;
return pattern.test (phone);
//Verify ID
function Iscardno (card) {
var pattern =/(^\d{15}$) | ( ^\d{18}$) | (^\d{17} (\d| X|X) $)/;
The above is a small set of jquery to introduce how to use regular expressions to verify the mobile phone number, ID number, Chinese name of the relevant knowledge, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. I also thank you for your support for the cloud-dwelling community website.