如何从{@if condtwo}匹配中获取内容{!if}?
{@if condtwo}
{@if condone}
show this if condone is true
{!if}
other contents
{!if} <- matching {!if}
我尝试使用preg_match_all. 这是我的正则表达式:
/([\s]*?{@IF(.*?)}[\s]*?)(.+?)([\s]*?{!$IF}[\s]*?)/si
问题是它只能从{@if condtwo}下一个获取所有内容{!if}:
{@if condtwo}
{@if condone}
this is a table
{!if}