<%
'====
Function stripTags( strToStrip )
'====
Dim objRegExp
strToStrip = Trim( strToStrip & "" )
If Len( strToStrip ) > 0 Then
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern= "<[^>]+>"
strToStrip = objRegExp.Replace(strToStrip, "")
Set objRegExp = Nothing
End If
stripTags = strToStrip
End Function
str="<p>Test paragraph.</p><!-- Comment --> <a href='#fragment'>Other text</a>"
response.write stripTags( str )
%>