Re: phone number regular expression problem



On 31 May 2006, svenugopaal@xxxxxxxxx wrote:

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

Think about the problem and write good requirements (yours are really
bad!). I hope this helps you more than a canned answer would.

Ted

p.s. real answer: look at Number::Phone

http://search.cpan.org/search?query=number%3A%3Aphone&mode=all
.



Relevant Pages