I have following code:
$content = <<<HTML
<p>{wrapper btnlabel="AAA"}zzzzzzzzzzzzzzzzzzzz{/wrapper}</p>
<p>{wrapper btnlabel="Text"}</p>
<table>
<tbody>
<tr>
<th scope="row">123</th>
<td>1 123</td>
<td>12 123</td>
<td>3 123</td>
<td>1 123 123</td>
</tr>
<tr>
<th scope="row">123</th>
<td>2700 123.</td>
<td>1800 123.</td>
<td>1000 123.</td>
<td>300 123.</td>
</tr>
</tbody>
</table>
<p>{/wrapper}</p>
HTML;
preg_match_all('#(?>{wrapper btnlabel=(?>"|")(.+)(?>"|")})(.*){/wrapper}#', $content, $matches);
var_dump($matches);
pattern doesn't match to second {wrapper...
. I think its because it split into multiple lines. But when i try s
modifier it match whole content from first {wrapper
until last {/wrapper}
in one. Replacement of \n
to ''
didn't help. So i'm confused. Maybe i miss something ?
https://ideone.com/ZMpSJ7 - here is the same test code