好些人跟我要這段東西,其實是個很簡單的代碼,下邊就是,自己拿去改成函數調用就可
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)