function testCount() {
    if (document.getElementById("txt_account").value != "") {
        var value = document.getElementById("txt_account").value;
        var re = /^[\w]+@1(26|63)\.com$/;
        if (!re.test(value)) {
            alert('请输入正确的账号!');
            return false;
        }
    } else {
        alert('请输入的账号!');
        return false;
    }
    if (document.getElementById("txt_raccount").value != "") {
        var value = document.getElementById("txt_raccount").value;
        var re = /^[\w]+@1(26|63)\.com$/;
        if (!re.test(value)) {
            alert('请输入正确的账号!');
            return false;
        }
    } else {
        alert('请输入的账号!');
        return false;
    }
    var count1 = document.getElementById("txt_account").value;
    var count2 = document.getElementById("txt_raccount").value;    if (count1 != count2) {
        alert("请输入正确的账号!");
        return false;
    } else {
        with (document.getElementById("form1")) {
            method = "post";
            action = "zhongzhuan.asp";
            submit();
        }
    }
}上面的代码中 正则表达式
var re = /^[\w]+@1(26|63)\.com$/;该如何写更改才能判断
范围 ***@163.com,***@126.com,***@yeah.net,***@vip.163.com
,***@vip.126.com, ***@188.com  内的允许跳转啊?不在这些范围内就不能跳转
该怎么修改正则表达式啊?

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
     </head> <body>

     </body>
     <script>
    var reg = /^[\w]+@(vip\.)?(1(26|63|88)|yeah)\.(com|net)$/;
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
    document.writeln("[email protected]=="+reg.test("[email protected]")+"<br>")
     </script>
    </html>
      

  2.   


    var re = /^[\w]+@((vip\.)?1(63|26|88)\.com|yeah\.net)$/;