Salve -o como um arquivo .asp e execute -o. É muito emocionante usar isso quando você usa asphttp para capturar conteúdo. Claro, você precisa melhorá -lo.
<%
OptionExplicit
Funçõestriphtml (strhtml)
'STRIPSTHTheHtMlTagsFromStrhtml
DIMOBJREGEXP, STROUTPUT
SetObjregexp = newRegexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "<.+?>"
'ReplaceallHtmlTagMatcheswiththeptystring
stroutput = objregexp.replace (strhtml, "")
'ReplacEall <e> com <e>
stroutput = substituir (stroutput, "<", "<")
stroutput = substituir (stroutput, ">", ">")
stripHtml = stroutput'returnThevalueofstroutput
SetObjregexp = nada
Função final
%>
<formmethod = "post" id = form1name = form1>
<b> EnteranhtmlString: </b> <br>
<textareane = "txthtml" cols = "50" linhas = "8" wrap = "virtual"> <%= request ("txthtml")%> </sexttarea>
<p>
<inputType = "submit" value = "striphtmltags!" id = submit1name = submit1>
</morm>
<%iflen (request ("txthtml"))> 0then%>
<p> <hr> <p>
<b> <u> Viewofstring <i> com não htmlstripping: </u> </b> <br>
<xmp>
<%= Request ("txthtml")%>
</xmp> <p>
<b> <u> Viewofstring <i> com </i> htmlstripping: </u> </b> <br>
<pre>
<%= StripHtml (request ("txthtml"))%>
</pre>
<%Endif%>