How does jQuery use regular expressions to verify mobile phone numbers, ID card numbers, Chinese names, and jquery regular expressions?
Digit Determination Method: isNaN () function
The test () method is used to determine whether the regular expression content is matched in the string. the return value is a boolean value (true/false)
// Verify the Chinese name function isChinaName (name) {var pattern =/^ [\ u4E00-\ u9FA5] {} $/; return pattern. test (name) ;}// verify the mobile phone number function isPhoneNo (phone) {var pattern =/^ 1 [34578] \ d {9 }$/; return pattern. test (phone) ;}// verify the ID card function isCardNo (card) {var pattern =/(^ \ d {15} $) | (^ \ d {18} $) | (^ \ d {17} (\ d | X | x) $)/; return pattern. test (card );}
The above section describes how jQuery uses regular expressions to verify mobile phone numbers, ID card numbers, and Chinese names. I hope this will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. I would like to thank you for your support for the help House website.