Function TransferHTML(ByVal source,para)
Dim objRegExp
'先换"&"
If Instr(para,"[&]")>0 Then source=Replace(source,"&","&")
If Instr(para,"[<]")>0 Then source=Replace(source,"<","<")
If Instr(para,"[>]")>0 Then source=Replace(source,">",">")
If Instr(para,"[""]")>0 Then source=Replace(source,"""",""")
If Instr(para,"[space]")>0 Then source=Replace(source," "," ")
If Instr(para,"[enter]")>0 Then
source=Replace(source,vbCrLf,"<br/>")
source=Replace(source,vbLf,"<br/>")
End If
If Instr(para,"[vbCrlf]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="((</?form[^n<]*>)|(<select[^n<]*>)|(<textarea[^n<]*>)|(</?option[^n<]*>)|(</?dl[^n<]*>)|(</?dt[^n<]*>)|(</?dd[^n<]*>)|(</?th[^n<]*>)|(</?tr[^n<]*>)|(</?td[^n<]*>)|(</?tbody[^n<]*>)|(</?table[^n<]*>)|(</?hr[^n<]*>)|(</?div[^n<]*>)|(</?ul[^n<]*>)|(</?li[^n<]*>)|(</?ol[^n<]*>)|(</?h1[^n<]*>)|(</?h2[^n<]*>)|(</?h3[^n<]*>)|(</?h4[^n<]*>)|(</?h5[^n<]*>)|(</?h6[^n<]*>)|(</?p[^n<]*>))(x20*(rn|n))"
source= objRegExp.Replace(source,"$1")
objRegExp.Pattern="(rn|n)"
source= objRegExp.Replace(source,"<br/>")
source=Replace(source,"<html>","")
source=Replace(source,"</html>","")
source=Replace(source,"<body>","")
source=Replace(source,"</body>","")
End If
If Instr(para,"[vbTab]")>0 Then source=Replace(source,vbTab," ")
If Instr(para,"[no-asp]")>0 Then
source=Replace(source,"<"&"%","<"&"%")
source=Replace(source,"%"&">","%"&">")
End If
If Instr(para,"[nofollow]")>0 Then
source=Replace(source,"<a ","<a rel=""nofollow"" ")
End If
If Instr(para,"[nohtml]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="<[^>]*>"
source= objRegExp.Replace(source,"")
End If
If Instr(para,"[filename]")>0 Then
source=Replace(source,"/","")
source=Replace(source,"","")
source=Replace(source,":","")
source=Replace(source,"?","")
source=Replace(source,"*","")
source=Replace(source,"""","")
source=Replace(source,"<","")
source=Replace(source,">","")
source=Replace(source,"|","")
source=Replace(source," ","")
End If
If Instr(para,"[normalname]")>0 Then
source=Replace(source,"$","")
source=Replace(source,"(","")
source=Replace(source,")","")
source=Replace(source,"*","")
source=Replace(source,"+","")
source=Replace(source,",","")
source=Replace(source,"[","")
source=Replace(source,"]","")
source=Replace(source,"{","")
source=Replace(source,"}","")
source=Replace(source,"?","")
source=Replace(source,"","")
source=Replace(source,"^","")
source=Replace(source,"|","")
source=Replace(source,":","")
source=Replace(source,"""","")
source=Replace(source,"'","")
End If
If Instr(para,"[textarea]")>0 Then
source=Replace(source,"&","&")
source=Replace(source,"%","%")
source=Replace(source,"<","<")
source=Replace(source,">",">")
End If
If Instr(para,"[html-format]")>0 Then
source=Replace(source,"&","&")
source=Replace(source,"<","<")
source=Replace(source,">",">")
source=Replace(source,"""",""")
End If
If Instr(para,"[anti-html-format]")>0 Then
source=Replace(source,""","""")
source=Replace(source,"<","<")
source=Replace(source,">",">")
source=Replace(source,"&","&")
End If
If Instr(para,"[wapnohtml]")>0 Then
source=Replace(source,"<br/>",vbCrLf)
source=Replace(source,"<br>",vbCrLf)
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="(<[^>]*)|([^<]*>)"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="(rn|n)"
source= objRegExp.Replace(source,"<br/>")
End If
If Instr(para,"[nbsp-br]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="<$|<b$|<br$|<br/$"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="^br/>|^r/>|^/>|^>"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="<br/>"
source= objRegExp.Replace(source,"<br/>")
objRegExp.Pattern="&nbsp;"
source= objRegExp.Replace(source," ")
End If
If Instr(para,"[closehtml]")>0 Then
source=closeHTML(source)
End If
TransferHTML=source
End Function