110,571
社区成员
发帖
与我相关
我的任务
分享
Regex reg = new Regex(@"(?is)<div\b(?:(?!id=).)*id=(['""]?)ShowPhoto\1[^>]*>((?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!)))</div>");
Regex reg = new Regex(@"(?is)(?<=<div\b(?:(?!id=).)*id=ShowPhoto[^>]*>)(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!))(?=</div>)");
Regex expression = new Regex("<div(?:.|\\n)*?id=ShowPhoto(?:.|\\n)*?>((?:.|\\n)*?)</div>", RegexOptions.IgnoreCase);
Group g = expression.Matches(text)[1].Groups[1];
Regex reg = new Regex(@"(?is)<div\b(?:(?!id=).)*id=(['""]?)ShowPhoto\1[^>]*>((?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!)))</div>");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[2].Value + "\n";
}