Public Function DecodeFilter(html, filter)
html=LCase(html)
filter=split(filter,",")
For Each i In filter
Select Case i
Case "Script" 'Remove all client scripts JavaScipt, VBScript, JScript, JS, VBS, Event, ...
Html = exce ("& lt;/? Script [^& gt;]*& gt;", "", html)
Case "TABLE": ' Remove the table
Html = exce ("& lt;/? Tr [^& gt;]*& gt;", "", "", html) Html = exce ("& lt;/? Th [^& gt;]*& gt;", "", "", html) Html = exce ("& lt;/? Td [^& gt;]*& gt;", "", "", html) Html = exce ("& lt;/? TBODY [^& gt;]*& gt;", "", html) Case "class" 'to remove style class class = " Html = Exre ("(& lt; [^& gt;]+) class = [^|^& gt;]*([^& gt;]*& gt;)", "$ 1 $ 2", html) Case "style" 'to remove style style = " Html = Exre ("(& lt; [^& gt;]+) style =" [^""] "" ([^& gt;]*& gt;) "," $ 1 $ 2 ", html) Html = exce ("(& lt; [^& gt;]+) style = '[^']*'([^& gt;]*& gt;)", "$ 1 $ 2", html) Case "img" 'Remove style style = " Html = exce ("& lt;/? Img [^& gt;]*& gt;", "", html) Case "XML" ' Remove XML Html = exere ("& lt; \? Xml [^& gt;]*& gt;", "", html) Case "namespace" '' Remove the name space & lt; o & gt; & lt;/o & gt; Html = exce ("& lt;/? [A-z]+: [^& gt;]*& gt;", "", html) Case "font" 'Remove the font & lt; font & gt; & lt;/font & gt; Html = Exray ("& lt;/? A [^& gt;]*& gt;", "", "", html) Html = Exre ("& lt;/? Span [^& gt;]*& gt;", "", "", html) Html = exce ("& lt;/? Br [^& gt;]*& gt;", "", "", html) Case "marquee" 'Remove subtitles & lt; marquee & gt; & lt;/marquee & gt; ‐‐‐ out can be found Html = Exray ("& lt;/? Object [^& gt;]*& gt;", "", html) 'html = exeRE("?embed[^>]*>", "", html) Case "EMBED" Html = Exre ("& lt;/? Embed [^& gt;]*& gt;", "", "", html) Case "DIV" 'Remove the object & lt; object & gt; & lt; param & lt; & lt; & lt;/object & gt; Html = exere ("& lt;/? Div ([^& gt;])*& gt;", "$ 1", html) Html = exce ("& lt;/? P ([^& gt;])*& gt;", "$ 1", html) Case "Online" 'Remove style style = " Html = Exre ("(& lt; [^& gt;]+) online =" "[^" "]" "([^& gt;]*& gt;)", "$ 1 $ 2", html) html = exeRE("(<[^>]+) onload='[^']*'([^>]*>)", "$1 $2", html) Case "ONCLICK" ' 去除样式 html = exeRE("(<[^>]+) onclick=""[^""]*""([^>]*>)", "$1 $2", html) html = exeRE("(<[^>]+) onclick='[^']*'([^>]*>)", "$1 $2", html) Case "ONDBCLICK" ' 去除样式 html = exeRE("(<[^>]+) ondbclick=""[^""]*""([^>]*>)", "$1 $2", html) html = exeRE("(<[^>]+) ondbclick='[^']*'([^>]*>)", "$1 $2", html) End Select Next 'html = Replace(html,"
|
---|