Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering Phone Numbers

Status
Not open for further replies.

LinuxGuy

Programmer
Nov 18, 2002
37
0
0
US
Can someone PostSome Code on Entering In a Phone Number w/ spaces or dashes such as 1 675 676 6765 or
1-712-876-6765 and have it go into the database that way thru ASP using Access> ?? im having tons of trouble with this


 
Can use one of this things.
I dont knw the simpliest method but this works 100% to

Code:
myPhone="1 675 676 6765"
set regEx=new RegExp
regEx.Pattern="[0-9] [0-9][0-9][0-9] [0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"
regEx.IgnoreCase = True
regEx.Global = True   
set rez=regEx.Execute(myPhone)
if rez.Count<>0 then 
'it's ok
end if

and

regEx.Pattern=&quot;[0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]&quot;
regEx.IgnoreCase = True
regEx.Global = True   
set rez=regEx.Execute(myPhone)
if rez.Count<>0 then 
'it's ok
end if

________
George, M
 
Here are some threads in 3 forums: ASP, VBScript and JavaScript. There may be more threads out there too. Regular Expression structure is identical (or nearly so) between VBScript (what ASP commonly uses) and JavaScript (popular on browser-side pages).

thread333-643879
thread329-628813
thread216-572361
thread216-417788
thread216-269561
thread216-79176
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top