You are missing the "
, , and
=
characters from your character class - they are part of the attributes on the tag. Use this:
Regex regex = new Regex("<[/a-zA-Z:\"' =]+>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
Edit: My first post included the '
character that I used to test with instead of the "
character - I've updated the code.