Example Analysis of regular expressions commonly used in JavaScript
This article mainly introduces the example analysis of regular expressions commonly used in JavaScript, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
Common regular expressions
/ / Mobile phone number regular var reg = / ^ 1 [0-9] {10} $/; / ID card number (18 digits) regular var cP = / ^ [1-9]\ d {5} (18 | 19 | ([23]\ d))\ d {2} ((0 [1-9]) | (10 | 11 | 12)) (([0-2] [1-9])) | 10 | 20 | 30 | 31)\ d {3} [0-9Xx] $/ / / Mailbox regular var reg = / ^ ([a-zA-Z] | [0-9]) (\ w |\ -) + @ [a-zA-Z0-9] +\. ([a-zA-Z] {2heli4}) $/ / / call method! reg.test (phone) / / Thank you for reading this article carefully. I hope the article "sample Analysis of regular expressions commonly used in JavaScript" shared by the editor will be helpful to you. At the same time, I hope you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!