62,039
社区成员
发帖
与我相关
我的任务
分享
Regex reg = new Regex(@"(?is)<SPAN[^>]*?STYLE=""text-decoration:underline;""[^>]*>.*?</SPAN>");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n";
}
Regex reg = new Regex(@"(?is)<SPAN[^>]*?STYLE=""text-decoration:underline;""[^>]*>>.*?</SPAN>");
void Main()
{
string html="<P STYLE=\"margin:0 0 0 0;font-family:宋?体??;font-size:13.3333333333333;\"> <SPAN>c</SPAN><SPAN STYLE=\"text-decoration:underline;\">o</SPAN><SPAN>mmon</SPAN></P>";
foreach(Match m in Regex.Matches(html,@"(?is)<span[^>]*style=(['""]?)text-decoration:underline;\1>.*?</span>"))
{
Console.WriteLine(m.Value);
}
}
/*
<SPAN STYLE="text-decoration:underline;">o</SPAN>
*/