111,129
社区成员
发帖
与我相关
我的任务
分享Regex reg = new Regex(@"(?s)原文转发(?:<[^>]*>)*\((?<transmit>\d+)\).*?原文评论(?:<[^>]*>)*\((?<comment>\d+)\)");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups["transmit"].Value + "\n";
richTextBox2.Text += m.Groups["comment"].Value + "\n";
}Regex reg = new Regex(@"(?s)原文转发(?:<[^>]*>)*\((\d+)\).*?原文评论(?:<[^>]*>)*\((\d+)\)");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[1].Value + "\n";
richTextBox2.Text += m.Groups[2].Value + "\n";
}