The content we store in the database is in HTML format, but sometimes we need to display this content in an unformatted manner, which is filtering using regular expressions.
The code copy is as follows:
<%
functionnohtml(str)
dimre
Setre=newRegExp
re.IgnoreCase=true
re.Global=True
re.Pattern="(/<.[^/<]*/>)"
str=re.replace(str,"")
re.Pattern="(/<//[^/<]*/>)"
str=re.replace(str,"")
nohtml=str
setre=nothing
endfunction
%>
Articles that may be of interest to you:
HTML tags and ASP function quick lookup table ASP.NET uses regular expressions to block spam ASP regular expression tips ASP regular expressions Several commonly used methods of regular expressions (execute, test, replace) ASP hyperlinks and HTML functions regular expressions correction version asp Use regular expressions to replace tags in word and convert them to plain text asp.net regular expressions to delete the specified HTML tag asp regular expressions using detailed explanation of the RegExp object regular expression function usage [Compare all] Regular expression quick lookup table (ASP.NET) asp automatically completes html tags automatically close (regular expression) ASP regular expressions to clear HTML specified tags