asp只采集网站可见文本的正则
发布时间:2016-12-29 来源:查字典编辑
摘要:我写的是这样:FunctionClearHTMLCode(originCode)Dimregsetreg=newRegExpreg.Igno...
我写的是这样:
Function ClearHTMLCode(originCode)
Dim reg
set reg = new RegExp
reg.IgnoreCase = True
reg.Global = True
reg.Pattern = "(<s+cript(.+?)</s+cript>)"
originCode= reg.Replace(originCode, "")
reg.Pattern = "(<s+tyle(.+?)</s+tyle>)"
originCode= reg.Replace(originCode, "")
reg.Pattern = "<[^>]*>"
originCode= reg.Replace(originCode, "")
ClearHTMLCode = originCode
End Function
不过有一些过滤不了!而且速度太慢!