regular

1. Match the email address

Let reg = / ^ (| [a zA - Z] [0-9]) | \ (\ w) + @ [a - zA - Z0-9] + \. ([a zA - Z] {2, 4}) $

2. (New) Match the mobile phone number

let reg = /^1[0-9]{10}$/;

3.(old) Match the phone number

let reg = /^1(3|4|5|7|8)[0-9]{9}$/;

4. A regular expression that matches passwords of 8 to 16 digits and letters

let reg = /^(? ! ([0-9] + $)? ! [a zA - Z] + $) [0-9 a zA - Z] 16th {8} $/;

5. National telephone number 0510-4305211

let reg = /\d{3}-\d{8}|\d{4}-\d{7}/;

6. Your id card

let reg=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;

7. Match the QQ number

let reg = /[1-9][0-9]{4,}/;

8. Match the IP address

let reg = /\d+\.\d+\.\d+\.\d+/;

9. Match Chinese

let reg = /^[\u4e00-\u9fa5]*$/