First, in time like these, you should first check
www.regexlib.com
which have a number of regex expression, free for the copying.
You may also want to try the "Regular Expression Workbench"
(
http://www.gotdotnet.com/Community/U...-4EE2729D7322).
Also free, and how I wrote this.
But, this seemed simple enough to try myself -- with one exception:
# and one + symbol
I'm going to assume that it's only allowed as the first character:
^\+?[-\d]*$
^ (anchor to start of string)
+
? (zero or one time)
Any character in "-\d"
* (zero or more times)
$ (anchor to end of string)
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
Thanks in advance
Venugopal.S