In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the jQuery verification of mobile phone number mailbox ID card regular expression how to write, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The following code is used in the page to verify using JQuery, but also in the background for verification, you can try, the same principle.
Go straight to the code: note: (of course, some verification rules are not just for this article, but there may be other better ones, you can leave a message.)
Mobile number: (mobile-Telecom-Unicom)
Var tel = $("# PhoneNumber"). Val (); / / get the entered mobile phone number var yidongreg = / ^ (012345678]\ d {7} | 1 [34578] [012356789]\ d {8}) $/; var dianxinreg = / ^ 1 [3578] [01379]\ d {8} $/; var liantongreg = / ^ 1 [34578] [01256]\ d {8} $/; / var reg = / ^ 1 [3 | 4 | 5 | 7 | 8]\ d {9} $/ / / this one can also be if (yidongreg.test (tel) | | dianxinreg.test (tel) | | liantongreg.test (tel)) {}
Mailbox:
Var emailvalue = $("# EmailUser"). Val (); / / get the entered mailbox / / var emailreg1 = / ^\ w+ ([- +.]\ w+) * @ ("@")\ w+ ([-.]\ w+) *.\ w+ ([-.]\ w+) * $/ / / this can also be var emailreg = / ^\ w+ ((-\ w+) | (\.\ w+)) *\ @ ("@") [A-Za-z0-9] + ((\. | -) [A-Za-z0-9] +) *. [A-Za-z0-9] + $/; if (emailreg.test (emailvalue)) {}
ID card:
Var userCardvalue = $("# UserIDCard"). Val (); / / get the input ID card var userCardreg = / (^\ d {15} $) | (^\ d {18} $) | (^\ d {17} (\ d | X | x) $) /; var taiwanreg=/ ^ [Amurz] [0-9] {9} $/; var xianggangreg=/ ^ [AMLIZ] [0-9] {6}\ ([0-9A]\) $/ Var aomenreg=/ ^ [157] [0-9] {6}\ ([0-9]\) $/ If (userCardreg.test (userCardvalue) | | taiwanreg.test (userCardvalue) | | xianggangreg.test (userCardvalue) | | aomenreg.t est (userCardvalue)) {} Thank you for reading this article carefully. I hope the article "jQuery verifies how to write the regular expression of your Mailbox ID Card" shared by the editor will be helpful to you. At the same time, I hope you can support it and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.