The code example is as follows:
<%
Option Explicit
Function striphtml (strhtml)
' Strips the HTML tags from strhtml
Dim objRegExp, Stroutput
Set objRegExp = New Regexp
Objregexp.ignorecase = True
Objregexp.global = True
Objregexp.pattern = "<.+?>"
' Replace all HTML tag matches with the empty string
Stroutput = Objregexp.replace (strHTML, "")
' Replace all < & > with < and >
Stroutput = Replace (Stroutput, "<", "<")
Stroutput = Replace (Stroutput, ">", ">")
striphtml = Stroutput ' Return the value of Stroutput
Set objRegExp = Nothing
End Function
%>
<form method= "POST" Id=form1 name=form1>
<b>enter an HTML string:</b><br>
<textarea name= "txthtml" cols= "rows=" "8" wrap= "virtual" ><%=request ("txthtml")%></textarea>
<p>
<input type= "Submit" value= "Strip HTML tags!" Id=submit1 name=submit1>
</form>
<% if Len (Request ("txthtml")) > 0 Then%>
<p>
<b><u>view of String <i>with no</i> HTML stripping:</u></b><br>
<xmp>
<%=request ("txthtml")%>
</xmp><p>
<b><u>view of string <i>with</i> HTML stripping:</u></b><br>
<pre>
<%=striphtml (Request ("txthtml"))%>
</pre>
<% End If%>