How about this:
string input = @"<p>style=""height:1px;""</p>
<div id=""F"" style=""height:2px; color:red"" runat=""Server"">
<p id=""p"" style=""height:3px; color:green"" />
</div>";
string pattern = @"<[^>]+style=""(?<style>[^""]+)""[^>]*>";
foreach (Match m in Regex.Matches(input, pattern))
{
if (m.Success)
{
m.Value.Dump();
string result = m.Groups["style"].Value;
Console.WriteLine(result);
}
}
If you need to match "style" with different cases, use Regex.Matches(input, pattern, RegexOptions.IgnoreCase) instead.
Document my code? Why do you think it's called "code"?