string oString="<table><tr><td><table><tr><td>TEST</td></tr></table></td></tr></table>";
string oRegStr=@".*(\<table\>[^\<]*(\<(?(?=\/table\>)|[^\<]*))+\/table\>)";
Regex oReg=new Regex(oRegStr);
Match oMatch=oReg.Match(oString);
string oResult="";
while(oMatch.Success){
oResult+=oMatch.Groups[1]+"\n";
oMatch=oMatch.NextMatch();
}
MessageBox.Show(oResult);
string oRegStr=@".*(\<table\>[^\<]*(\<(?(?=\/table\>)|[^\<]*))+\/table\>)";
Regex oReg=new Regex(oRegStr);
Match oMatch=oReg.Match(oString);
string oResult="";
while(oMatch.Success){
oResult+=oMatch.Groups[1]+"\n";
oMatch=oMatch.NextMatch();
}
MessageBox.Show(oResult);
(<table>(.(?!<table>))*?</table>)