Copy Code code as follows:
'==================================================
' Function name: scripthtml
' Function: Filter HTML tags
' Parameter: constr------The string to filter
'==================================================
Function scripthtml (Byval constr,tagname,ftype)
Dim Re
Set re=new REGEXP
Re.ignorecase =true
Re.global=true
Select Case FType
Case 1
Re.pattern= "<" & TagName & "([^>]) *>"
Constr=re.replace (Constr, "")
Case 2
Re.pattern= "<" & TagName & "([^>]) *>.*?</" & TagName & "([^>]) *>"
Constr=re.replace (Constr, "")
Case 3
Re.pattern= "<" & TagName & "([^>]) *>"
Constr=re.replace (Constr, "")
Re.pattern= "</" & TagName & "([^>]) *>"
Constr=re.replace (Constr, "")
End Select
Scripthtml=constr
Set re=nothing
End Function
1 content=scripthtml (content, "BR", 1) ' Remove all <br>html marks
2 content=scripthtml (Content, "a", 2) ' Remove the contents between all <a></a> and two tags
Like <a href=www.126.com>www.126.com</a> the whole piece.
3 content=scripthtml (content, "TD", 3) ' Remove <td> and </td>html mark
such as <td>-bureaucrat Caesar </td> take <td> </td> removed but the scholar-bureaucrat still retains
And so on, you filter all the other HTML tags, div objdect or something.