过滤方法:
response.write ReP("需要过滤的内容",1)

'关键词过滤,types=1整句过滤;types=2关键词替换
Function ReP(Str,types)
StrBadWords="美沙酮|美沙酮|麦司卡林|麦角酸二乙基酰胺|吗啡|可卡因|咖啡因|海洛因"
arrayList=split(StrBadWords,"|")
set re=New RegExp
For i=0 To Ubound(arrayList)
   If types=1 Then
    keywords=Trim(arrayList(i))
    re.Pattern = "[,,.。!!]*[^,,.。!!]*"&keywords&"[^,,.。!!]*[,,.。!!]*"
    re.IgnoreCase = True
    're.Global = True
    Str=re.replace(Str,"。")'替换为一个自己想设的语句结束符号
   Else
    Str=Replace(Str, ""&arrayList(i)&"", "××")
   End If
Next
Set re=Nothing
ReP=Str
End Function

相关文章:

  • 2021-05-19
  • 2022-01-18
  • 2022-12-23
  • 2021-10-19
  • 2022-01-23
  • 2021-09-16
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2021-08-11
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
相关资源
相似解决方案