Test for Alphanumeric Characters

Results 1 to 2 of 2

Thread: Test for Alphanumeric Characters

  1. #1
    VB_Man Guest

    Default Test for Alphanumeric Characters

    All I want to do is test a string and make sure that it consists only of alphanumeric characters (letters and numbers). I am using this from a VB DLL, so it must in VBScript, not JAVAscript. I am trying to use the RegEx.TEST method, which returns a true or false. Can somebody put up some sample code for me?

  2. #2
    Join Date
    Dec 1969

    Default RE: Test for Alphanumeric Characters

    Here&#039;s VBScript. If this is true you matched something other than a letter or number. Add s to the pattern if spaces are ok. If you want to use this in VB you have to include a reference to Sripting Runtime.<BR><BR>Set objRegExp = New Regexp <BR>objRegExp.Pattern = "[^a-zA-Z0-9]"<BR>Response.Write(objRegExp.Test(Text))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts