Skip to content

Instantly share code, notes, and snippets.

@gwobcke
gwobcke / stripStringHTML.asp
Created June 15, 2011 13:51
Classic ASP Strip HTML Function
<%
FUNCTION stripHTML(strHTML)
Dim objRegExp, strOutput, tempStr
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|n)+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with &lt; and &gt;