<?php
$pattern = "/<p.*p>|<div[^>]+>/";
$str = "<div style=\"width:100px\">无语<p>hi</p></div>";
preg_match_all($pattern,$str,$matches);
var_dump($matches);
?>
请问为什么结果是:
array (size=1)
0 =>
array (size=2)
0 => string '<div style="width:100px">' (length=25)
1 => string '<p>hi</p>' (length=13)
应该先匹配出p标签吗?