/ Published in: ASP
URL: http://reusablecode.blogspot.com/2008/12/striptags.html
Strip all HTML/ASP/PHP tags from a string; essential for validating user input. (But not solely sufficient for validating user input. Use additional methods as appropriate.)
Expand |
Embed | Plain Text
<% ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved. ' ' This work is licensed under the Creative Commons Attribution License. To view ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California ' 94305, USA. ' Strip HTML/ASP/PHP tags from a string. function strip_tags(unsafeString) dim regEx set regEx = new RegExp with regEx .Global = true .IgnoreCase = true .Pattern = "(\<(/?[^\>]+)\>)" end with strip_tags = regEx.Replace(unsafeString, "") set regEx = nothing end function %>
You need to login to post a comment.
