Recently in the work of the need to determine whether a number is a mobile phone number, whether it is a landline number.
On the internet also found that we summarize the method, did not directly use these methods is because: mobile phone number in the beginning of a new number segment (such as 17x), the number of the landline in the individual area code due to changes in the administrative region abolished.
The regular expressions for mobile phones and landlines here are based on the latest mobile number segment that the author has currently found, with the area code (as of August 2015).
Landline number: http://baike.baidu.com/view/103379.htm.
New Regex (@ "^0?" ( 10| (2|3[1,5,7]|4[1,5,7]|5[1,3,5,7]|7[1,3,5,7,9]|8[1,3,7,9]) [0-9]|91[0-7,9]| (43|59|85) [1-9]|39[1-8]|54[3,6]| (701|580|349|335) |54[3,6]|69[1-2]|44[0,8]|48[2,3]|46[4,7,8,9]|52[0,3,7]|42[1,7,9]|56[1-6]|63[1-5]|66[0-3,8]|72 [2,4,8]|74[3-6]|76[0,2,3,5,6,8,9]|82[5-7]|88[1,3,6-8]|90[1-3,6,8,9]) \d{7,8}$ ");
Phone Number: http://baike.baidu.com/view/58286.htm
New Regex (@ "^0?" ( 13\d|14[5,7]|15[0-3,5-9]|17[0,6-8]|18\d) \d{8}$ ");
Please note that this regular expression:
The following formats are supported phone number: 013622335533,13622335533; Landline: 01087654321,1087654321
The following formats are not supported phone number: 17951139012345678; landline: 010-88554433; (010) 85443322;+86 10 32454433;
However, the above listed regular expressions only need a little modification to support the above-listed format, please use your mind to solve it:).
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Regex phone number landline regular expression