var str = "436748";
if(str.match(/436748|436745|532450|532458/)){
return true;
}else{
return false;
}

解决方案 »

  1.   

    <SCRIPT >
    function findingNemo(x)
    {
    var CardNo= new String("436748,436745,532450,532458");
    var Arr=CardNo.split(",");
    var D = new ActiveXObject("Scripting.Dictionary");
    for(i=0;i<Arr.length;i++)
    {
    D.add(Arr[i],Arr[i]);
    } if(D.Exists(x))
    {
    return true ;
    }
    else
    {
    return false ;
    }
    }
    alert(findingNemo("1234"));
    alert(findingNemo("436748")); 
    </SCRIPT>
      

  2.   

    <SCRIPT >
    function findingNemo(x)
    {
     
    if(x.match(/436748|436745|532450|532458/))
    {
    return true;
    }else
    {
    return false;
    } }
    alert(findingNemo("1234"));
    alert(findingNemo("436748")); 
    </SCRIPT>
      

  3.   

    多谢,还要问一下,我在asp中也要判断,vbscript中怎么用方便呢?
      

  4.   

    vbscript就容易多了。
    <%
    function find(x)
    find=false
    dim CardNo
    CardNo="436748,436745,532450,532458"
    for each aaa in split( CardNo,",")
    if x=aaa then 
    find=true
    exit for
    end if
    next
    end function 
    %>
      

  5.   

    <script language="VBScript">
    Function CheckStr(s)
    Set re = New RegExp
    re.Pattern = "436748|436745|532450|532458"
    re.Global = True
    retval = re.Test(s)
    If retval Then
      CheckStr="OK"
    Else 
      CheckStr="Wrong"
    End If
    End Function
    msgbox CheckStr("436748")
    msgbox CheckStr("436")
    </script>