I have a simple template system and a regular expression catch some specials tags like if conditions. now I need an if condition inside an if condition and my current expression breaks on the first if-endtag.
I tried (?R) and some other but either I don't get any HTML tags inside the brackets or they break on the first /#if
{{{#if(.*?)}}}(.*?){{{\/#if}}}
and my HTML code
{{{#if:header:!=:}}}
<div class="header">
<h1>
{{{header}}}
{{{#if:header_bar:!=:}}}
<div class="headbuttons">
{{{header_bar}}}
</div>
{{{/#if}}}
</h1>
</div>
{{{/#if}}}
expected ist one return from #if:header:!=:}}} to the second /#if
can someone help me please to get this work?