Verify that the mobile phone number is valid using the re
var reg = /^[1](3|[5-9])\d{9}$/
Copy the code
Phone number must be 1 beginning is the beginning of the regular [1] second phone number currently has 356789 so we went on to write (3 | [5-9]) the remaining nine is random Numbers so we use \ d {9} beginning with ^ end with $limit so you can match the phone number
Verify that the id number is valid with the re
var reg4 = /^[1-9]\d{5}\d{4}\d{2}\d{2}\d{2}\d(\d|X)$/
Copy the code
1-9, was the first one is two to six random number \ d {5} is four origins (date) (month) (year) after \ d {4} \ d {2} \ d {2} after random number two \ d {2} the penultimate a singular represents the doubles number is the last one is female \ d Numbers or X (\ d | X)