js phone number regular verification -- landline and mobile phone numbers

Original text: http://blog.csdn.net/u010697983/article/details/39525453


1. The latest phone number segment:

Mobile: 134 (except 1349) 135 136 137 138 139

      147
      150 151 152 157 158 159

      182 183 184 187 188

China Unicom: 130 131 132 
  155 156 
185 186 
145

Telecom: 133 153 177 180 181 189

2. Regular phone number:

Fixed line: ([0-9]{3,4}-)?[0-9]{7,8}

Mobile: ^((\+?86)|(\(\+86\)))?(13[012356789][0-9]{8}|15[012356789][0-9]{8}|18 [02356789][0-9]{8}|147[0-9]{8}|1349[0-9]{7})$

3. Check function

[html]  view plain copy  
  1. function checkCount(){  
  2.     var  isPhone  = / ^ ([0-9] {3,4} -)? [0-9] {7,8} $ /;  
  3.     var  isMob = / ^ ((\ +? 86) | (\ (\ + 86 \)))? (13 [012356789] [0-9] {8} | 15 [012356789] [0-9] {8} | 18 [02356789] [0-9] {8} | 147 [0-9] {8} | 1349 [0-9] {7}) $ /;  
  4.     var value=document.getElementById("ss").value.trim();  
  5.     if(isMob.test(value)||isPhone.test(value){  
  6.         return true;  
  7.     }  
  8.     else{  
  9.         return false;  
  10.     }  
  11.     }  


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325881613&siteId=291194637