public static Regex CreateTagRegex(string name)
{
string pattern = @"<\s*{0}[^>]+>";
pattern = string.Format(pattern, name);
return new Regex(
pattern,
RegexOptions.CultureInvariant
| RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.ExplicitCapture
);
}