存成.asp文件,执行,你用ASPHTTP抓内容的时候用这个很爽,当然自己要改进一下了
<%
OptionExplicit
FunctionstripHTML(strHTML)
'StripstheHTMLtagsfromstrHTML
DimobjRegExp,strOutput
SetobjRegExp=NewRegexp
objRegExp.IgnoreCase=True
objRegExp.Global=True
objRegExp.Pattern="<.+?>"
'ReplaceallHTMLtagmatcheswiththeemptystring
strOutput=objRegExp.Replace(strHTML,"")
'Replaceall<and>with<and>
strOutput=Replace(strOutput,"<","<")
strOutput=Replace(strOutput,">",">")
stripHTML=strOutput'ReturnthevalueofstrOutput
SetobjRegExp=Nothing
EndFunction
%>
<formmethod="post"id=form1name=form1>
<b>EnteranHTMLString:</b><br>
<textareaname="txtHTML"cols="50"rows="8"wrap="virtual"><%=Request("txtHTML")%></textarea>
<p>
<inputtype="submit"value="StripHTMLTags!"id=submit1name=submit1>
</form>
<%ifLen(Request("txtHTML"))>0then%>
<p><hr><p>
<b><u>Viewofstring<i>withno</i>HTMLstripping:</u></b><br>
<xmp>
<%=Request("txtHTML")%>
</xmp><p>
<b><u>Viewofstring<i>with</i>HTMLstripping:</u></b><br>
<pre>
<%=StripHTML(Request("txtHTML"))%>
</pre>
<%EndIf%>