JavaScript clears function code in html text format
<%
'/* Function name: Zxj_ReplaceHtml ClearHtml
'/* Function Language: VBScript Language
'/* Usage: Clear the file HTML format Function
'/* Transfer parameter: Content (Note: Content to be cleared)
'/* Function Author: Zhang Xiaojun (Ancient City fairy tale) QQ: 382511147
'/* Function Description: Regular Expression (Regular Expression) mode for data matching and replacement
Function ClearHtml (Content)
Content = Zxj_ReplaceHtml ("& # [^>] *;", "", Content)
Content = Zxj_ReplaceHtml ("</? Marquee [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Object [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Param [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Embed [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Table [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("& nbsp;", "", Content)
Content = Zxj_ReplaceHtml ("</? Tr [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Th [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? P [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? A [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Img [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Tbody [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Li [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Span [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Div [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Th [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Td [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Script [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("(javascript | jscript | vbscript | vbs):", ", Content)
Content = Zxj_ReplaceHtml ("on (mouse | exit | error | click | key)", "", Content)
Content = Zxj_ReplaceHtml ("<\\? Xml [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("<\/? [A-z] +: [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Font [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? B [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? U [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? I [^>] *> "," ", Content)
Content = Zxj_ReplaceHtml ("</? Strong [^>] *> "," ", Content)
ClearHtml = Content
End Function
Function Zxj_ReplaceHtml (patrn, strng, content)
IF IsNull (content) Then
Content = ""
End IF
Set regEx = New RegExp 'to create a regular expression.
RegEx. Pattern = patrn 'setting mode.
RegEx. IgnoreCase = true' is used to set case-insensitive characters.
RegEx. Global = true' to set Global availability.
Zxj_ReplaceHtml = regEx. Replace (content, strng )'
End Function
%>
Usage:
Directly call ClearHtml ()