Asp判断字符串只能是数字或字母组合:

<form method=get>
<input type="text" name="txt" id="txt"/>
<input type="submit"/>
</form>
<%
if request("txt")<>""   then
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^[a-zA-Z][^\W_]*$"
if regEx.test(request("txt")) = true then
response.write "正确"
else
response.write "错,只允许字母开头的 字母或数字组合!"
end if
Set regEx =nothing
end if
%>