I feel it's much more rewarding to do your own regex's, unless you are
really stumped at something (this example is not that hard by the way)
If you would like to learn how to do it yourself, I would suggest this site,
it has many examples.
http://regexplib.com
And there are many tutorial sites to help you as well.
http://gnosis.cx/publish/programming...pressions.html http://www.regular-expressions.info/
Basically the easiest way to do this one is to use the | delimiter to
specify three different regex's for each phone number.
firstway|secondway|thirdway. The first way would be something like this
\d{3}-\d{4}. If you really wanted to have fun, you could probably do this
without using the | operator, but I wouldn't do that if this is your first
regex experience.
HTH,
--Michael
"Ori" <or*******@hotmail.com> wrote in message
news:b4**************************@posting.google.c om...
Hi,
I'm looking for a good way to validate a US phone number and i though
using regular expression for this.
I want to support 3 different ways to enter a phone number:
1.Local Phone : 888-8899
2.With extension: (310)888-2569
3.With extension + 1 : 1(888)789-2569
Can someone tell me what expression I can us in order to support those
3 methods at once ?
Thanks,
Ori.