28,391
社区成员
发帖
与我相关
我的任务
分享
<%
str="6565656"
if RegExpfind("[\da-z]*", str) then
Response.write "有包含数字"
else
Response.write "没有包含数字"
end if
%>
<%
str="6565656"
if RegExpfind("[\d]+", str) then
Response.write "有包含数字"
else
Response.write "没有包含数字"
end if
Function RegExpfind(p, s)
Dim re
Set re = New RegExp
re.Pattern = p
re.Global = True
RegExpfind = re.Test(s)
End Function
%>
'//--正则检测--//
Function isMach(str,reg)
if isnull(str) or str="" then isMach=false:exit function
Set regEx = New RegExp
regEx.Pattern = reg
regEx.IgnoreCase = true
regEx.Global = true
isMach = regEx.test(str)
Set reg=nothing
End Function
if isMach("sdfd333", "\d+") then
Response.write "有包含数字"
else
Response.write "没有包含数字"
end if