php 正则,帮我看下是什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/08 08:47:21
$str = "rrrr<{list_page(class_id, pagesize)}>rrr<{list(class_id, list_num, order)}>rrrr<{content}>rr";
$reg = "/<{[^}>]+}>/";
preg_match_all($reg, $str, $m);
print_r($m);

大家帮我看看正则可对?? 需要哪些改动呢???
<table width="600" border="1" align="center" cellpadding="1" cellspacing="1">
<{LIST(10011002,10,0,0)}>
<tr>
<td width="100"><{LIST:id}></td>
<td><{LIST:title}></td>
</tr>
<{/LIST}>
</table>

<table width="600" border="1" align="center" cellpadding="1" cellspacing="1">
<{PICLIST(10011002,10,0,0)}>
<tr>
<td width="100"&

对的
匹配每一个<{....}>

不过不是非常完美
如果想要<{....}>之间间可以出现“>”
(也就是可以匹配“<{list_page(class_id>1, pagesize)}>”)
那应该是
$reg = "/<{(.*?)+}>/";