这个正则则们写  等待高手 
我写的 非正则;var forbid_arr=new Array("www","mail","http","smtp","ftp","pop3","*home*");   function checkp(hj){
  var pl = forbid_arr.length;
  for (var i=0;i<=pl-1;i++){
  if (hj==forbid_arr[i]){
    return false;
  } 
}
 return true;
}

解决方案 »

  1.   

    有一个  *home* 的模式,你没有匹配这个
      

  2.   

    var forbid_arr=new Array("www","mail","http","smtp","ftp","pop3","*home*"); 
    //要一个 正则表达式 ,当输入的value 和这个数组的任意一个匹配时,返回false
    vat matchstr = "www"
    var str = "\x0f"+matchstr+"\x0f\x0f"+forbid_arr.join("\x0f\x0f") +"\x0f"
    alert(testexists(str))
    vat matchstr = "www1"
    var str = "\x0f"+matchstr+"\x0f\x0f"+forbid_arr.join("\x0f\x0f") +"\x0f"
    alert(testexists(str))
    function testexists(a){
        return /(\x0f[^\x0f]+\x0f)[\s\S]*?\1/g.test(a)
    }
      

  3.   

    var forbid_arr=new Array("www","mail","http","smtp","ftp","pop3","*home*"); 
    //要一个 正则表达式 ,当输入的value 和这个数组的任意一个匹配时,返回false
    vat matchstr = "www"
    var str = "\x0f"+matchstr+"\x0f\x0f"+forbid_arr.join("\x0f\x0f") +"\x0f"
    alert(testexists(str))
    vat matchstr = "www1"
    var str = "\x0f"+matchstr+"\x0f\x0f"+forbid_arr.join("\x0f\x0f") +"\x0f"
    alert(testexists(str))
    function testexists(a){
        a = a.replace("*","@@@")
        return /(\x0f[^\x0f]+\x0f)[\s\S]*?\1/g.test(a)
    }
      

  4.   

    为方便正则初学者,专门作了代码优化.
    以下是完整代码html:<?xml version="1.0" encoding="gb2312"?><html>
    <head><meta http-equiv="content-type" content="text/html; charset=gb2312" />
    <meta http-equiv="author" content="Langtse(http://langtse.51.net)" />
    <title></title></head>
    <body><script type="text/javascript">
    /*<![CDATA[*/
    var arrSample=new Array("www","email","mail","http","*home*","home","same","pop","smtp","ftp","pop3","www1");
    function strCheck(sValue)
    {
    this.strExcept="(?:www)";
    this.strExcept+="|(?:mail)";
    this.strExcept+="|(?:http)";
    // 你可在此仿照『this.strExcept+="|(?:无效字符串)";』格式加入其它无效字符串;
    this.strExcept+="|(?:smtp)";
    this.strExcept+="|(?:ftp)";
    this.strExcept+="|(?:pop3)";
    this.strExcept+="|(?:[*]home[*])";
    // 以上每行都加入一个无效字符串;
    this.expExcept=new RegExp("^("+this.strExcept+")$","gi");
    return sValue.search(this.expExcept)?true:false;
    }
    for(i in arrSample)
    {
    alert(i+"."+arrSample[i]+":"+strCheck(arrSample[i]));
    }
    /*]]>*/
    </script></body>
    </html>
      

  5.   


    //this.strExcept+="|(?:[*]home[*])";
    this.strExcept+="|(?:\*home\*)";