\+)?\d+$/) != -1);
}
function isUnsignedInteger(strInteger) {
return (strInteger.search(/^\d+$/) != -1);
}
</script>
<HTML>
<BODY>
判断数字的正确性
<%
Dim strTemp
strTemp = CStr(Request.Form("inputstring"))
If strTemp = "" Then strTemp = "0"
%>
<TABLE BORDER="1" CELLPADDING="4" CELLSPACING="2">
<TR>
<TD ALIGN="right">原始字符串</TD>
<TD><%= strTemp %></TD>
</TR>
<TR>
<TD ALIGN="right">数字</TD>
<TD><%=isNumeric(strTemp)%></TD>
</TR>
<TR>
<TD ALIGN="right">非负数字</TD>
<TD><%=isUnsignedNumeric(strTemp)%></TD>
</TR>
<TR>
<TD ALIGN="right">整数</TD>
<TD><%=isInteger(strTemp)%></TD>
</TR>
<TR>
<TD ALIGN="right">非负整数()</TD>
<TD><%=isUnsignedInteger(strTemp)%></TD>
</TR>
</TABLE>
<FORM ACTION="<%=Request.ServerVariables("SCRIPT_NAME")%>" METHOD="post">
请输入一个数字:
<INPUT TYPE="text" NAME="inputstring" SIZE="50"></INPUT>
<INPUT TYPE="submit" Value="提交"></INPUT>
</FORM>
</BODY>
</HTML>
2、判断Email地址的正确性
<%
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^\w+((-\w+)(北联网教程,专业提供视频软件下载)
……