Home All Groups Group Topic Archive Search About

phone number regular expression problem

Author
31 May 2006 1:24 PM
venu
Hi,
I have a different requirement and it is :

I need to validate a phone number field.
It may or may not be a US phone number.

The constraints are :
***********************

#   It should accept any number of numbers
#   any number of - hyphens
#   and one + symbol
#   no other characters and alphabets are allowed

Thanks in advance

Venugopal.S

Author
31 May 2006 1:30 PM
Charlie Brown
^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1}){0,1}98(\s){0,1}(\-){0,1}(\s){0,1}[1-9]{1}[0-9]{7}$
Author
31 May 2006 2:18 PM
Dave
Hi,

You should be able to get started with this, at least...

^[\d-]*\+?[\d-]*$

Hope that helps.

Dave


venu wrote:
Show quoteHide quote
> Hi,
> I have a different requirement and it is :
>
> I need to validate a phone number field.
> It may or may not be a US phone number.
>
> The constraints are :
> ***********************
>
> #   It should accept any number of numbers
> #   any number of - hyphens
> #   and one + symbol
> #   no other characters and alphabets are allowed
>
> Thanks in advance
>
> Venugopal.S