SoFunction
Updated on 2025-03-10

Complete collection of regular expressions for mobile phone number and license plate number in Android

Phone number

The mobile phone name has GSM: It means that only supports China Unicom or China Mobile 2G segment (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182, 185, 186, 187, 188)

The mobile phone name has CDMA: It means that only supports China Telecom 2G segment (133, 153, 180, 181, 189)

The mobile phone name is WCDMA/GSM: It means that it supports China Unicom or China Mobile 2G segment, as well as China Unicom 3G segment (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182, 183, 185, 186, 187, 188), does not support mobile 3G services, and does not support telecom cards.

The mobile phone name is TD-SCDMA/GSM: It means that it supports China Unicom or China Mobile 2G segment, as well as China Mobile 3G segment (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182, 183, 185, 186, 187, 188), and does not support China Unicom 3G services and does not support telecom cards.

The mobile phone name is CDMA2000/CDMA: It means that it supports China Telecom No. 2G segment and China Telecom No. 3G segment (133, 153, 180, 181, 189), and does not support China Unicom card.

The phone name is CDMA2000/GSM (dual mode and dual standby): means that one card supports China Telecom's 2G segment, as well as China Telecom's 3G segment (133, 153, 180, 181, 189), and the other card supports the voice and SMS functions of China Mobile or China Unicom's 2G segment.

170 number segment for third-party operators

Supplement: Unicom 4G 176, Telecom 4G 177, Mobile 4G 178 Section

The regular expression functions written based on these are as follows:

 public static boolean isMobileNO(String mobiles) {
     String telRegex = "\\d{}|[]\\d{}|[]\\d{}|[]\\d{}|[]\\d{}";
     if ((mobiles)) return false;
     else return (telRegex);
   }

in:

"13\\d{9}" means the first two digits are 1 and 3, followed by any 9 digits;

"14[57]\\d{8}" means that the first two digits are 1 and 4, the third digit is 5 or 7, followed by any 8 digits;

And so on.

License plate number

Regular expressions for license plate numbers have always been available online, but have not changed much:

 public static boolean isCarnumberNO(String carnumber) {
     /*
      License plate number format: Chinese characters + A-Z + bit A-Z or-
      (Only the ordinary license plate numbers are included, and the license plate numbers of coach cars and some military vehicles are not included)
      */
     String carnumRegex = "[\ue-\ufa]{}[A-Z]{}[A-Z_-]{}";
     if ((carnumber)) return false;
     else return (carnumRegex);
   }

Of course, this regular expression has limitations. For example, the first position is limited to Chinese characters, and there are no restrictions on only 34 provinces of Chinese characters; the license plate number does not have letters I and O, which prevents confusion with 1 and 0; some license plates cannot be distinguished, etc.

The above content is the complete collection of regular expressions for mobile phone numbers and license plate numbers in Android introduced to you in this article. I hope it will be useful to you.