Category Archives: Extension Methods

C#: Regular Expressions to Filter HTML to a Whitelist of Allowable Tags

If you are looking to “sanitize” your HTML to a whitelist of allowable tags, here’s a bit of code that may help. It is a string extension that uses regular expressions to “clean up” your HTML input. The original code … Continue reading

Posted in C#, Extension Methods, Regular Expressions | 2 Comments