asp只采集网站可见文本的正则
程序员文章站
2022-05-19 11:17:42
我写的是这样: function clearhtmlcode(origincode) dim reg set reg = new regexp reg.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
不过有一些过滤不了!而且速度太慢!
上一篇: 鱼腥草怀孕可以喝吗,对胎儿有影响吗