|
jlosquared -> RE: HELP! (4/23/2008 15:39:13)
|
ok, in the generator there is : <%
Function return_good_value(incoming_string)
Dim incoming_regex_violations, was_found_violation, incoming_regex_spchrs, was_found_spchrs, Match
Set incoming_string_violations = New RegExp : Set area_code = New RegExp : Set prefix_digits = New RegExp : Set full_phone_number = New RegExp
incoming_string=Replace(incoming_string, "(", "")
incoming_string=Replace(incoming_string, ")", "")
incoming_string_violations.Pattern = "([(]|[a-zA-Z]{1,}|[)])": incoming_string_violations.IgnoreCase = True
full_phone_number.Pattern = "(\d{3}[\-]\d{3}[\-]\d{4})": full_phone_number.IgnoreCase = True
area_code.Pattern = "\d{3,}" : area_code.IgnoreCase = True
prefix_digits.Pattern = "(\d{3}[\-]\d{3})" :prefix_digits.IgnoreCase = True
set full_phone_number_matches = full_phone_number.Execute(incoming_string)
set violation_matches = incoming_string_violations.Execute(incoming_string)
set area_code_matches = area_code.Execute(incoming_string)
set prefix_digits_matches = prefix_digits.Execute(incoming_string)
was_found_violation = incoming_string_violations.Test(incoming_string)
If not was_found_violation Then
If full_phone_number.Test(incoming_string) Then
For each Match in full_phone_number_matches
return_good_value = Match.Value
Next
ElseIf prefix_digits.Test(incoming_string) Then
For each Match in prefix_digits_matches
return_good_value = Match.Value
Next
ElseIf area_code.Test(incoming_string) Then
For each Match in area_code_matches
return_good_value = Match.Value
Next
End If
Else
return_good_value = "OOPS! INVALID DATA <BR>"
For each Match in violation_matches
return_good_value = return_good_value & Match.Value & "." & "<BR>" & vbCRLF
Next
End If
End Function
%>
<% Dim SqlJunk : Dim validity_check : Dim dbGlobalWeb : Dim strSearchString
Set dbGlobalWeb = Server.CreateObject("ADODB.Connection") : dbGlobalWeb.Open("database") : SqlJunk = "SELECT * FROM tbl_Dealers" : validity_check=0
|
|
|
|