Regular Expression Find Tag within another tag

dev*_*234 2 html regex tags

I want to find all br tags inside of table tag using regular expressions. This is what I have so far:

<table[^>]*>(((<br/>)(?!</table>)).)*</table>
Run Code Online (Sandbox Code Playgroud)

But this code doesn't work in notepad++.

This is what am testing the regular expression with:

<table>
</table>
<table>
<br/>
</table>
Run Code Online (Sandbox Code Playgroud)

Basically the last 3 lines should be found with the regular expressions but the one regular expression I listed above doesn't find anything.

Ara*_*Fey 5

尝试

<table(?: [^<>]+)?>(?:(?!</table>).)*<br/>.*?</table>
Run Code Online (Sandbox Code Playgroud)

使用点匹配所有修饰符s

演示。

解释:

<table # start with an opening <table> tag
(?: [^<>]+)?
>
(?: # then, while...
    (?! #...there's no </table> closing tag here...
        </table>
    )
    . #...consume the next character
)*
<br/> # up to the first <br/>
.*? # once we've found a <br/> tag, simply match anything...
</table> #...up to the next closing </table> tag.
Run Code Online (Sandbox Code Playgroud)