[BangPypers] regular expression for Indian landline numbers

Mandar Vaze / मंदार वझे mandarvaze at gmail.com
Fri Nov 26 07:00:12 CET 2010

> So all one really needs to do (say if one wants to call back) is to extract
> one single 10 digit number using the above logic by stripping off the
> optional prefixes and the extra characters (which I presume would be quite
> trivial). But then maybe my mind is not working well today early morning :)

Kenneth's original email (
doesn' say whether he wishes to validate or extract.

Depending on how far one wants to go - validation of phone number (depending
on additional  information one may have) can get very complex.

e.g. If one needs to validate a landline telephone number for person staying
in chhatisgadh - then a valid telephone number like 080-3033777 is NOT valid
in this case since this number belongs to b'lore.

Similarly for mobile numbers, not ALL 10 digit numbers starting with 9,8 or
7 are valid. Several 4 digit codes in 8xxx, and 7xxx are unallocated - hence
look at http://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India
(But kenneth may have already looked at this)

So depending on how accurate the validation needs to be - this can be very
interesting validation problem.
One can always take simplistic view - if the requirements are fulfilled.


More information about the BangPypers mailing list