62,041
社区成员
发帖
与我相关
我的任务
分享
dsfsdfdsf<div class="ab"> dsf <div><span>fd</span></div>dsfdsfdsf</div>
<div class="ab"> gfdfsgfdgfd</div>dsfdsf
Regex reg = new Regex(@"(?is)<div\s+class=""ab"">(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!))</div>");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n--------------\n";
}