boolean = IsAlphaNumeric(string)
Example Usage:
ASP Source Code:<% ' IsAlphaNumeric returns True response.write IsAlphaNumeric("This Thing") response.write IsAlphaNumeric("This_Thing 155088_45515") response.write IsAlphaNumeric("Some_Other Thing_25") response.write IsAlphaNumeric(17968) ' IsAlphaNumeric returns False response.write IsAlphaNumeric("(37.8)") response.write IsAlphaNumeric("37.8A[") response.write IsAlphaNumeric("ABSD= acscrrrw!") response.write IsAlphaNumeric("11200-5432") %>
<% Private Function IsAlphaNumeric(byVal string) dim regExp, match, i, spec For i = 1 to Len( string ) spec = Mid(string, i, 1) Set regExp = New RegExp regExp.Global = True regExp.IgnoreCase = True regExp.Pattern = "[A-Z]|[a-z]|\s|[_]|[0-9]|[.]" set match = regExp.Execute(spec) If match.count = 0 then IsAlphaNumeric = False Exit Function End If Set regExp = Nothing Next IsAlphaNumeric = True End Function %>