VBA 使用正则剔除HTML标签

Function RemoveHTML(strText)
Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Pattern = ""
RegEx.Global = True
strText = RegEx.Replace(strText, "")

Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Pattern = ""
RegEx.Global = True
strText = RegEx.Replace(strText, "")

Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
End Function

你可能感兴趣的:(VBA 使用正则剔除HTML标签)