日期:2014-05-20  浏览次数:20761 次

请问怎么用正则过滤到font标签里的除了color外的其他属性???
<font style="filter: glow(color=#0000FF,strength=3);color:#FFFFFF;display:inline-block;" >
比如这个标签里,只想保留
<font style="color:#FFFFFF;" >
谢谢了。。。

------解决方案--------------------
C# code
   string subjectString = "<font style=\"filter: glow(color=#0000FF,strength=3);color:#FFFFFF;display:inline-block;\" > ";
            string regex1 = "<.+=\"";
            string regex2 = @"color:[^;]+";
            string result1 = Regex.Match(subjectString, regex1).Value;
            string result2 = Regex.Match(subjectString, regex2).Value;
            string result = result1 + result2 + ";\" >";