Compilation failed: syntax error in subpattern name (missing terminator) at offset 46
- PHP code
$str = "<div class='a'><div>cc</div>a<span>ab</span>c<div class='b'>xxxy</div></div>"; preg_match_all("#((?'open'<div[^>]*>)((?:.(?!</?div))*.)*?)((?'-open'</div[^>]*>)((?:.(?!</?div))*.)*?)#is",$str,$matches); print_r($matches);
请教一下,是不是PHP 不支持组平衡啊
------解决方案--------------------
"#((?'open'<div[^>]*>)((?:.(?!</?div))*.)*?)((?:'-open'</div[^>]*>)((?:.(?!</?div))*.)*?)#is",