string a="<style color='red' font='size:14px;' > d>fcolor<>d<font.f </style>";
1.用正则表达式取出“ d>fcolor<>d<font.f ”; 也就是<style>标签中的内容。
2.用正则表达式取出“red”,  也就是 color后面的颜色.
   希望会的帮帮忙。

解决方案 »

  1.   


                string a = "<style color='red' font='size:14px;' > d>fcolor<>d<font.f </style>";
                Regex reg = new Regex(@"(?<=<style.*>).*(?=</style>)");            foreach (Match m in reg.Matches(a))
                    Console.WriteLine(m.Value);
      

  2.   


                string a = "<style color='red' font='size:14px;' > d>fcolor<>d<font.f </style>";
                Regex reg1 = new Regex(@"(?<=color=').*?(?=')");
                foreach (Match m in reg1.Matches(a))
                    Console.WriteLine(m.Value);