答案 0 :(得分:9)
使用php,您可以使用preg_match_all
:
$str = '<td>Data 1</td>
<td>data 2</td>
<td>data 3</td>
<td>data 4</td>
';
preg_match_all('/(?:<td>(.+?)<\/td>\s*)/', $str, $m);
print_r($m);
<强>输出:强>
Array
(
[0] => Array
(
[0] => <td>Data 1</td>
[1] => <td>data 2</td>
[2] => <td>data 3</td>
[3] => <td>data 4</td>
)
[1] => Array
(
[0] => Data 1
[1] => data 2
[2] => data 3
[3] => data 4
)
)