Javascript wildcards?

Discussion in 'OT Technology' started by 2000GT, Jun 22, 2004.

  1. 2000GT

    2000GT Active Member

    Joined:
    Jan 21, 2001
    Messages:
    5,767
    Likes Received:
    6
    Location:
    Vancouver
    Is there such thing as the * or % wildcard in javascript. I want to valid a line of code so that it won't allow anything with the word BOX or box... can I do something like == "*BOX*"

    what can I do?
     
  2. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    Code:
    var input = blahboxblah;
    var testinput = input.toUpperCase();
    
    if (testinput.indexOf('BOX') == -1) {
           doStuff();
    } else {
           bitchslap();
    }
    :dunno:
     

Share This Page