I want to get all the names of class used in my html file. I've tried so far in C#
String data = Uri.UnescapeDataString(TextBox1.Text);
List<string> allClass = new List<string>();
Match match = Regex.Match(data, "class=\"[^#]+\"");
if (match.Success)
{
Console.WriteLine(match.Captures[0].Value); // Will output "#item3#"
}
but this is not giving the desired result. as my code is
<div class="dialogBodyWrapper">
<div class="dialogBoxContentParent">
<p class="mediumText">Changing your authentication details will log you out from the current session
and requires re-login with new credentials. Would You like to proceed?</p>
</div>
<div class="clear"></div>
</div>
I want class names in list like dialogBodyWrapper,dialogBoxContentParent,mediumText and clear.
I've tried many regex expression but none is working for me. Please help me.