need some help with recursive patterns here
i have
$test='<tr><td>1.1</td><td>1.2</td><td>1.3</td><td>1.4</td></tr>
<tr><td>2.1</td><td>2.2</td><td>2.3</td><td>2.4</td></tr>';
i need a regex that gives
Array
(
[0] => Array
(
[0] => 1.1
[1] => 1.2
[2] => 1.3
[3] => 1.4
)
[1] => Array
(
[0] => 2.1
[1] => 2.2
[2] => 2.3
[3] => 2.4
)
)
if i use
%<td> ( (?>[^(<td>|</td>)]+) | (?R) )* </td>%x
i get
Array
(
[0] => 1.1
[1] => 1.2
[2] => 1.3
[3] => 1.4
[4] => 2.1
[5] => 2.2
[6] => 2.3
[7] => 2.4
)
how to integrate the <tr>?
i couldn't get two nested recursive patterns to work 🙁