Re: phone number regular expression problem



venu wrote:
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


You mean the following are acceptable phone numbers:
"+"
"----------------------"
"12345+56789"
"203980234092-091234-0918234-982-34989834-09283-098349821-0394-219384-02918-092834-012983490"

but these are not:
"800 723 9374"
"(0234)23249"

nor this:
"08000 CONTACTS"

I've assumed you actually meant "zero or one + symbol".
.



Relevant Pages

  • Re: phone number regular expression problem
    ... venu wrote: ... I need to validate a phone number field. ... # no other characters and alphabets are allowed ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Marquee For Firefox
    ... This poster - zero ... being hard or impossible to validate, ... think the idea is you just make your own DTD which includes marquee, ... which doesn't look at the DTD qua a DTD at all. ...
    (alt.html)
  • Re: Warning - DO NO TRY TO VALIDATE VISTA BEFORE NEXT TUESDAY
    ... but of course preventing Microsoft's own zero day exploit. ... attempts to validate will fail, leading Vista to think it is not a valid ... You might add turn off auto updating completely, thereby leaving ...
    (microsoft.public.windows.vista.general)
  • Re: table does not show until resizing
    ... since the JDialog was already visible. ... Until you do a validate, the table might have zero size. ... The layout mananger has not assigned it a size yet. ...
    (comp.lang.java.gui)
  • Re: Regular expression
    ... I need a regular expression that validate a list of numbers separated ... Untested BTW. I've made 78-034-89 invalid, as a number should not start with zero, unless it's only 1 zero. ...
    (comp.lang.php)