This is going to take you down the road of pulling your hair out, as people
have all kinds of interesting ways to format phone numbers when given the
chance. How about, instead of one big free text entry field, you have three
separate fields, one for area, one for city, and one for the last four
digits? Then you just check the length/numeric of each of the three parts.
You don't have to worry about -, (), ., etc. You could make this dynamic if
you also need to support UK and other country phone formats. When they
select their country you can use client-side script to change the designated
phone number. (You might also do something similar for zip/postal codes.)
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
I have a script that looks for a phone number. I use an instr to see if
it finds a - for the phone number. I them grab the 3 characters before
and 4 after for the phone number. Works well, except when someone uses
the - in the text.
How can look for the second instance of the - if the right 4 characters
past the - are not numeric?
Thanks!
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!