简单过滤一下广告的代码


好些人跟我要这段东西,其实是个很简单的代码,下边就是,自己拿去改成函数调用就可

dim strA,strB,isOK
strA = "test,you,fuck,money" '需要过滤的关键字内容
strB = "fasfaefwTestfajkewhfwiTuckjfksajfheyou" '待检查的内容
isOK = False '判断是否含有待过滤内容,如果返回True即为含有,False就是没有

dim RegExp
set RegExp=new RegExp
RegExp.IgnoreCase =False
RegExp.Global=True

dim i,j
j = ubound(split(strA,","))
for i=0 to j
RegExp.Pattern="("&split(strA,",")(i)&")"
if(RegExp.Test(strB))then
isOK=True
exit for
end if
next
set RegExp=Nothing
response.write(isOK)

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3