DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Jeffrey has posted 20 posts at DZone. View Full User Profile

Strip HTML Tags From Strings Using Classic ASP And Regular Expressions

06.06.2008
| 20766 views |
  • submit to reddit
        From <a href="http://www.bpsdesigns.co.uk/tutorials/using-regular-expressions-with-classic-asp/">http://www.bpsdesigns.co.uk/tutorials/using-regular-expressions-with-classic-asp/</a>

Function stripTags(HTMLstring)
	Set RegularExpressionObject = New RegExp
	With RegularExpressionObject
		.Pattern = "<[^>]+>"
		.IgnoreCase = True
		.Global = True
	End With
	stripTags = RegularExpressionObject.Replace(HTMLstring, "")
	Set RegularExpressionObject = nothing
End Function