JS Regular mobile Phone Liang processing ab ABAB AABB

Source: Internet
Author: User

Beautiful number detection: The main can detect the connection number (positive connection 12345, 65432), AABB number, mobile phone number, date number (birthday, annual), Abbcabb, 3 more than repeat number. More type number detection can be modified according to the following expression.
1. Match 6-bit increment (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9) {5}\d 2. Match 6-bit shun-drop (?: 9 (? =8) |8 (? =7) |7 (? =6) |6 (? =5) |5 (? =4) |4 (? =3) (|3) (?) (? =2) | (. =1)) {=0 3. Match 6-bit straight up or down (?:(?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {5}| (?: 9 (? =8) |8 (? =7) |7 (? =6) |6 (? =5) |5 (? =4) |4 (? =3) (|3) (?) (? =2) | (? =1)) {5}) =0 4. Match 4-9 consecutive digits (?:(?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {3,}| (?: 9 (? =8) |8 (? =7) |7 (? =6) |6 (=5) |5 (? =4) |4 (? =3) |3 (? =2) (? =1) () (? =0)) {3,}) \d 5. Matches 3-bit repetitions ([\d]) \1{2, 6. Number matching date type (19|20) [\d]{2} (1[0-2]|0?) [1-9]) (31|2[0-9]|1[0-9]|0?) [0-9]) 7. Mobile number Class (13[0-9]|15[0-9]|18[0-9]) ([\d]{2,4}) {2} 8. Match 33111 type ([[\d]) \1{1,} ([\d]) \2{2,} 9. Match 5331533 type ([\d ] {1,} ([\d]) {1,}) \1{1,} 10, matching 22334,123355 type ([\d]) \1{1,} ([\d]) \2{1,} 11. The bottom match $//aabb, which allows AAAA (\d) \1 (\d) \2$//abab, Allow AAAA (\d) (\d) \1\2$//aaab to allow AAAA (\d) \1\1\d$//while allowing (?:( \d) \1 (\d) \2| (\d) (\d) \3\4| (\d) \5\5\d) $//above if AAAA is not allowed, the second (\d) instead ((?! \1) \d)//such as AABB, not allow AAAA (\d) \1 (?! \1) \d) \2$ var reg = new RegExp ("(?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {5}\\d "," G "); if (Phone.match (reg) = null) {code + = ', ABCDEF '; } var reg = new RegExp ("?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\d "," G "); if (Phone.match (reg) = null) {code + = ', ABC '; } var reg = new RegExp ("^ (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9) {2}\\d[\\d][\\d] (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\d "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 3) = = Result.substring (5,8)) {code + = ', abc**abc '; }} var reg = new RegExp ("[\\d] (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9) {2}\\d[\\d] (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\d$ "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (1, 4) = = Result.substring (5, 8)) {code + = ', *abc*abc '; }} var reg = new RegExp ("(\\d) (?! \\1) \\d) \\2[\\d] "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 1) = = Result.substring (3, 4)) {code + = ', ABBA '; }} var reg = new RegExp (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\d{4} "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 3) = = Result.substring (3, 6)) {code + = ', abcabc '; }} var reg = new RegExp ("^ (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\D{4} "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 3) = = Result.substring (3, 6)) {code + = ', abcabc* '; }} var reg = new RegExp (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {2}\\d{3} "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 2) = = Result.substring (3, 5)) {code + = ', Abcab '; }} var reg = new RegExp (?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {3}\\d "," G "); if (Phone.match (reg) = null) {code + = ', ABCD '; } var reg = new RegExp ("?: 0 (? =1) | (? =2) (? =3) |3 (? =4) |4 (? =5) |5 (? =6) |6 (? =7) |7 (? =8) |8 (? =9)) {3}\\d{5} "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). TostriNg (); if (result.substring (0, 4) = = Result.substring (4, 8)) {code + = ', Abcdabcd '; }} var reg = new RegExp ("(\\d) (?! \\1) \\d) \\1\\2\\1\\2 "," G "); if (Phone.match (reg) = null) {code + = ', Ababab '; } var reg = new RegExp ("^ (\\d) (?! \\1) \\d) \\1\\2\\1\\2 "," G "); if (Phone.match (reg) = null) {code + = ', ababab* '; } var reg = new RegExp ("(\\d) (?! \\1) \\d) \\1\\2 "," G "); if (Phone.match (reg) = null) {code + = ', ABAB '; } var reg = new RegExp ("^ (\\d) (?! \\1) \\d) [\\d][\\d] (\\d) ((?! \\1) \\d) [\\d][\\d] "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (result.substring (0, 2) = = Result.substring (4, 6)) {code + = ', ab**ab** '; }} var reg = new RegExp ("[\\d][\\d] (\\d) ((?! \\1) \\d) [\\d][\\d] (\\d) ((?! \\1) \\d) $ "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (Result.substring (2, 4) = = Result.substring (6, 8)) {code + = ', **ab**ab '; }} var reg = new RegExp (' ([\\d]) \\1{4,} ', "G"); if (Phone.match (reg) = null) {code + = ', AAAAA '; } var reg = new RegExp (' (.) \\1{3} ', "G"); if (Phone.match (reg) = null) {code + = ', AAAA '; } var reg = new RegExp (' (\\d) \\1\\1 ((?! \\1) \\d) ', "G"); if (Phone.match (reg) = null) {code + = ', Aaab '; } var reg = new RegExp (' (.) \\1{2} ', "G"); if (Phone.match (reg) = null) {code + = ', AAA '; } var reg = new RegExp (' (.) \\1{1} ', "G"); if (Phone.match (reg) = null) {code + = ', AA '; } var reg = new RegExp ("(\\d) \1 ((?!\\1) \\d) \\2\\2 "," G "); if (Phone.match (reg) = null) {code + = ', aabbb '; } var reg = new RegExp ("(\\d) \\1 ((?! \\1) \\d) \\2 "," G "); if (Phone.match (reg) = null) {code + = ', AABB '; } var reg = new RegExp ("(\\d) \\1 ((?! \\1) \\d) ((?! \\1) \\d) \\3 "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (Result.substring (2, 3)! = result.substring (0, 1) && result.substring (2, 3)! = result.substring (3, 4)) { Code + = ', aabcc '; }} var reg = new RegExp ("(\\d) \\1 ((?! \\1) \\d) \\2 ((?! \\1) \\d) \\3 "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (Result.substring (2, 4)! = result.substring (0, 2) && result.substring (2, 4)! = Result.substring (4, 6)) { Code + = ', aabbcc '; }} var reg = new RegExp ("^ (\\d) \\1 (?! \\1) \\d) \\2 ((?! \\1) \\d) \\3 "," G "); if (Phone.match (reg) = null) {var result = Phone.match (reg). toString (); if (Result.substring (2, 4)! = result.substring (0, 2) && result.substring (2, 4)! = Result.substring (4, 6)) { Code + = ', aabbcc* '; } }

JS Regular mobile Phone Liang processing ab ABAB AABB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.