In 2019, we used JavaScript regex

(HH:mm:ss) /^((? :[01]\d|2[0-3]):[0-5]\d:[0-5]\d/ Copy code base64 format /^\sdata:([a-z]+/[a-z0-9-+.]+(; [a-z-]+=[a-z0-9-]+)?) ? (; base64)? ,([a-z0-9!/ I Copy code number/currency amount (support negative numbers, thousandth separator) /([1]? [1-9] \ d {0, 2},| (. \ d {1, 2}/ Copy code number/currency amount (positive number only, check thousandth separator not supported) /([2]([0-9] +)? (. [0-9] {1, 2})?) | ([3].0-9?[u4e00-\u9fa5·]{2,10})/ Copy code is not new energy license plate number /[4]{1}[a-hJ-NP-z]{1}[A-z0-9]{4}[a-z0-9 hang Hong Kong police]{1}/ copy code URL link (URL) /^((HTTPS? |ftp|file)://)? ([\ da – z -] +). ([a-z.] {2, 6}) (/ \ w. -])/? Phone number/copy code (serious), according to the ministry of industry and the latest mobile phone them roughly 2019 / ^ 1 ((3 [\] d) | |,6,7,9 [5] (4) (5 [0, 3, 5-9]) | (6 [5-7]) | (7-8 0 and 3) | (8 [\] d) | (9,8,9 [1])) \ d {8}/^1\d{10} /^1\d{10}/ copy code email address /^\w+([-+.]\w+)@\w+([-.]\w+).\w+([-.]\w+)/ copy code 18 second generation id card number (digits) and the last one is the check digit, may for digital or character X / ^ \ d {6} (18 19 20) | | \ d {2} (0 \ | d | 11, 12) (\ [0-2] d | | 30 31) \ d {3} (\ d | | X X))|(^\d{6}(18|19|20)\d{2}(0\d|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)/ Copy code pure Chinese/Chinese characters /[5]+/ copy code phone (landline) /^0\d{2,3}-\d{7,8}/ Copy code whether HTML tag /<(.) >.< 1 > / \ | < (.) />/ copy the code to see if the QQ number format is correct /[6][0-9] {4, 10}/ Copy code with pure English letters /[7]+/ Copy code in pure uppercase letters /[8]+% ^ &? ] ). */ copy code ipv4 address regular /^(? : (? : 25 [0 to 5] | 2 [0 to 4] [0-9] | [01]? [0-9] [0-9]?) .). {3} (? : 25 [0 to 5] | 2 [0 to 4] [0-9] | [01]? [0-9] [0-9]?)/ Copy code micro signal, 6 to 20 characters, beginning with a letter, letter, digit, minus sign, underscore /[9]([- _a – zA – Z0-9] {5} 3) +/ copy code Contains only Chinese and number / ^ (([\ u4E00 – \ u9FA5]) | (\ d)) +/


  1. – ↩ ︎

  2. 1-9 ↩ ︎

  3. 0-9 ↩ ︎

  4. Beijing, Tianjin, Shanghai, Chongqing, Hebei, Yun, Liao, Hei, Xiang, Anhui, Lu, Xinsu, Zhejiang, Gan, Hubei, GUI, Jin, Meng, Shaanxi, Ji, Min, GUI, Guangdong, Qinghai, Sichuan, Ning, Qiong, Leging a-Z ↩︎

  5. \ u4E00 – \ u9FA5 ↩ ︎

  6. 1-9 ↩ ︎

  7. A zA – Z ↩ ︎

  8. A-z ↩ ︎

  9. A zA – Z ↩ ︎