[BangPypers] regular expression for Indian landline numbers
Navin Kabra
navin.kabra at gmail.com
Fri Nov 26 04:39:06 CET 2010
On Fri, Nov 26, 2010 at 9:03 AM, Dhananjay Nene <dhananjay.nene at gmail.com>wrote:
> Thus there could be the optional prefixes +91 or 0 followed by an
> additional
> sequence of numbers which may have embedded some spaces, hyphens or in rare
> cases parenthesis which are quite ignorable.
>
> 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 :)
>
This might be veering off from the original subject a bit, but since you
brought it up, here's the code I use for extracting an "Indian" phone number
from various different ways in which users might enter that...:
http://pastebin.com/GRyLgePr
No, it's not an regexp like Kenneth wants. But I've found this piece of code
to be useful in a number of different contexts...
More information about the BangPypers
mailing list