C# code
Regex regExp = new Regex(@"(?isx)<ul[^>]*>(?><ul[^>]*>(?<o>)|</ul>(?<-o>)|(?:(?!</?ul\b).)*)*(?(o)(?!))</ul>");
MatchCollection mc = regExp.Matches(htmlcode)
foreach(Match m in mc)
……
[/Quote]
速度之快 太厉害了 逍遥!
try
C# code
Regex regExp = new Regex(@"(?isx)<ul[^>]*>(?><ul[^>]*>(?<o>)|</ul>(?<-o>)|(?:(?!</?ul\b).)*)*(?(o)(?!))</ul>");
MatchCollection mc = regExp.Matches(htmlcode)
foreach(Match m in mc)
{
……
[/Quote]
Regex regExp = new Regex(@"(?isx)<ul[^>]*>(?><ul[^>]*>(?<o>)|</ul>(?<-o>)|(?:(?!</?ul\b).)*)*(?(o)(?!))</ul>");
MatchCollection mc = regExp.Matches(htmlcode)
foreach(Match m in mc)
{
m.Value;//这就是ul段
}