展开全部
用正则表达式,凡是匹配[^a-zA-Z0-9]的就有问题,例子如下:
<%
str="abc@def"
Set regEx = New RegExp
regEx.Pattern = "[^a-zA-Z0-9]"
regEx.IgnoreCase = True
If regEx.Test(CStr(g)) Then
response.write "有非法字符"
Else
response.write "没有有非法字符"
End If
%>
<%
str="abc@def"
Set regEx = New RegExp
regEx.Pattern = "[^a-zA-Z0-9]"
regEx.IgnoreCase = True
If regEx.Test(CStr(g)) Then
response.write "有非法字符"
Else
response.write "没有有非法字符"
End If
%>
展开全部
用正则表达式,凡是匹配[^a-zA-Z0-9]的就有问题,例子如下:
<%
str="abc@def"
Set regEx = New RegExp
regEx.Pattern = "[^a-zA-Z0-9]"
regEx.IgnoreCase = True
If regEx.Test(CStr(g)) Then
response.write "有非法字符"
Else
response.write "没有有非法字符"
End If
%>
<%
str="abc@def"
Set regEx = New RegExp
regEx.Pattern = "[^a-zA-Z0-9]"
regEx.IgnoreCase = True
If regEx.Test(CStr(g)) Then
response.write "有非法字符"
Else
response.write "没有有非法字符"
End If
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询