SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Maher's Avatar
    Join Date
    Mar 2003
    Location
    Somewhere Close..
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Reading a string with unwanted character..

    What is the best solution to read a string text that contains any of the following characters using Instr and Select Case statments?

    Possible characters to detect:
    ~ # $ % ^ & * ( ) [ ] ? > < !

    For example, I tried using the following but it's not working and is lengthy:

    Code:
    <% dim email
    
    email="This is a ~ test messgae!"
    
    select Case email
    Case InStr(email,"~")>0 Response.Redirect("/error.asp")
    Case InStr(email,"!")>0 Response.Redirect("/error.asp")
    end select
    
    %>

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    A regular expression would be the most efficient.

    Here's a good tutorial:
    http://www.4guysfromrolla.com/webtech/090199-1.shtml


Bookmarks

Posting Permissions

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