Phone number format Regular Expressions

/ ** 
* determine whether the correct phone format
* @param Mobiles
* @return
* Mobile: 134,135,136,137,138,139,147 (wireless LAN), 150,151,152,157,158,159, 182,183,187,188,178
* China Unicom: 130,131,132,145 (wireless LAN), 155,156,185 (open after iPhone5 listed), 186,176 (4G number segment),
* 175 (2015 on September 10 officially opened, temporarily only to Beijing, Shanghai and Guangdong delivery apply)
* Telecom: 133,153,180,181,189,177,173,149
* summed up the first must be 1, the second bits must be 3 or 4 or 5 or 7 or 8, other locations may be 0-9
* /
Private Boolean isMobileNO (String Mobiles) {
// String telRegex = "[. 1] [34578] \\ {D}. 9" ;
String telRegex = "^. 1 ([38 is] [0-9] |. 4 [579] |. 5 [^. 4] |. 6 [. 6] |. 7 [0,135,678] |. 9 [89]) \\ {D} $. 8 ";
! return TextUtils.isEmpty (Mobiles) && mobiles.matches (telRegex);
}

Guess you like

Origin www.cnblogs.com/mwl523/p/11082542.html