手动阀

Good Luck To You!

如何在ASP中有效去除HTML内容中的style、JavaScript和CSS代码?

在ASP中,可以使用正则表达式来去除HTML中的style、javascript和css代码。以下是一个示例代码:,,``asp,Function RemoveHtmlTags(strInput), Dim regEx, Match, Matches, Set regEx = New RegExp, regEx.IgnoreCase = True, regEx.Global = True, regEx.Pattern = "]*>([\s\S]*?)|]*>([\s\S]*?)|]*>", Set Matches = regEx.Execute(strInput), For Each Match in Matches, strInput = Replace(strInput, Match.Value, ""), Next, RemoveHtmlTags = strInput,End Function,`,,这个函数会移除输入字符串中的所有, `标签及其内容。
<< 1 >>

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.