May
27
27
How to remove Bad Junk HTML Tags in C#
public static string RemoveBadHTMLTags(string htmlContent)
{
Regex TagRegex = new Regex(
“(<script>.*</script>)|(<object>.*</object>)|(<body>.*</body>) |
(<embed>.*</embed>)|(<frameset>.*</frameset>)|
(<frame>.*</frame>)|
(<iframe>.*</iframe>)|(<meta>.*</meta>)|(<ling>.*</ling>)|
(<style>.*</style>)”);
html = TagRegex.Replace(htmlContent, “”);
return htmlContent;
There are no comments.