这一正则表达式判断错在哪里??? 请求帮助!在线等-----
怎么才能验证输入的字符只能是英文字符,数字和下划线
我在后台是这么验证的,不能通过。请求大们的帮助~!
if checkexp("^\\w+$",request.Form("textfield20"))=false then
Response.write "<script language='JavaScript'>alert('用户名只能是英文字符,数字和下划线。');window.history.go(-1)</script>"
response.end
end if
' 正则表达式检查数据。
public function checkexp(patrn,strng) 'partrn为正则表达式;strng为提交的数据
dim regex,match
set regex=new regexp
regex.pattern=patrn
regex.Ignorecase=false
regex.global=true
matches=regex.test(strng)
checkexp=matches
end function