aspHtml2Ubb函数
来源:互联网 发布:无人机app源码 编辑:程序博客网 时间:2024/06/04 20:31
Function Html2Ubb(str)
If Str<>"" And Not IsNull(str) Then
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(on(load|click|dbclick|mouseover|mouseout|mousedown|mouseup|mousewheel|keydown|submit|change|focus)=""[^""]+"")"
str = re.Replace(str, "")
re.Pattern="((name|id|class)=""[^""]+"")"
str = re.Replace(str, "")
re.Pattern = "(<s+cript[^>]*?>([/w/W]*?)<//s+cript>)"
str = re.Replace(str, "")
re.Pattern = "(<iframe[^>]*?>([/w/W]*?)<//iframe>)"
str = re.Replace(str, "")
re.Pattern = "(<p> <//p>)"
str = re.Replace(str, "")
're.Pattern = "<(/w*) class/s*=/s*([^>|/s]*)([^>]*)>"
'str = re.Replace(str,"<$1$3>")
Set re=Nothing
Html2Ubb = str
Else
Html2Ubb = ""
End If
End Function