I'm using some regex to sanitize tags from text
static string Pattern = "<(?:[^>=]|='[^']*'|=\"[^\"]*\"|=[^'\"][^\\s>]*)*>";
static public string StripHtml(string Value)
{
return Regex.Replace(Value, Pattern, string.Empty);
}
Although this seems pretty secure, I'm wondering if it really is? Is there a way to execute XSS without using tags?
Would it be better to use a markdown editor, or is that still going to have similar issues because they allow tags as well?
Or should I just manually parse the tags I want and allow them to put what ever?