Hi,
I want to use search() to check if a string contains any illegal characters. Problem is that I can't find out how to do it when the illegal variables come from a string. It should be something like below. Only this doesn't work.

Code:
function check_string(mystr,taboos)
{ var patt = "/["+taboos+"]/"; // this doesn't work but I don't know what will
  if(mystr.search(patt) == -1)
    return true;
  else
  { alert("The following characters are not allowed: "+taboos+" - "+myelt.value);
    return false;
  }

if(!check_string("Hello world","<>;=#{}")) // string should not contain any of these characters
      return;
}