(?is)<tr[^>]*>(?><tr[^>]*>(?<o>)|</tr>(?<-o>)|(?:(?!</?tr\b).)*)*(?(o)(?!))</tr>
变型--01
(?is)<div[^>]*>(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!))</div>
例子 <div[^>]*>转化 <div class="rb">
<div class="rb">(?><div[^>]*>(?<o>)|</div>(?<-o>)|(?:(?!</?div\b).)*)*(?(o)(?!))</div>原文链接:https://www.f2er.com/regex/363232.html