html转换成UBB代码
Function Html2Ubb(str)
If Str<>"" And Not IsNull(Str) Then
Dim re,tmpstr
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern = "(<STRONG>)":Str = re.Replace(Str,"<b>")
re.Pattern = "(<\/STRONG>)":Str = re.Replace(Str,"</b>")
re.Pattern ="(<TBODY>)":Str = re.Replace(Str,"")
re.Pattern ="(<\/TBODY>)":Str = re.Replace(Str,"")
re.Pattern ="(<TABLE)":Str = re.Replace(Str,"<table")
re.Pattern ="(TABLE>)":Str = re.Replace(Str,"table>")
re.Pattern ="(<TR)":Str = re.Replace(Str,"<tr")
re.Pattern ="(TR>)":Str = re.Replace(Str,"tr>")
re.Pattern ="(<TD)":Str = re.Replace(Str,"<td")
re.Pattern ="(TD>)":Str = re.Replace(Str,"td>")
re.Pattern ="(<DIV)":Str = re.Replace(Str,"<div")
re.Pattern ="(Div>)":Str = re.Replace(Str,"div>")
re.Pattern ="(<IMG )":Str = re.Replace(Str,"<img ")
re.Pattern ="(<BR)":Str = re.Replace(Str,"<br")
re.Pattern ="(<A )":Str = re.Replace(Str,"<a ")
re.Pattern ="(<\/A>)":Str = re.Replace(Str,"</a>")
re.Pattern ="(<FONT )":Str = re.Replace(Str,"<font ")
re.Pattern ="(<\/FONT>)":Str = re.Replace(Str,"</font>")
re.Pattern = "(<s+cript(.+?)<\/s+cript>)":Str = re.Replace(Str, "")
re.Pattern ="(\{)":Str = re.Replace(Str,"{")
re.Pattern ="(\})":Str = re.Replace(Str,"}")
re.Pattern ="(\$)":Str = re.Replace(Str,"$")
're.Pattern = "(<div>|<div(.+?)>)":Str = re.replace(Str,"<div>")
're.Pattern = "(<span>|<span(.+?)>)":Str = re.replace(Str,"<span>")
Set Re=Nothing
Html2Ubb = Str
Else
Html2Ubb = ""
End If
End Function