php正则组平衡有关问题
时间:2021-07-01 10:21:17
帮助过:11人阅读
php正则组平衡问题
Compilation failed: syntax error in subpattern name (missing terminator) at offset 46
PHP code
$str = "ccaabcxxxy";
preg_match_all("#((?'open']*>)((?:.(?!?div))*.)*?)((?'-open'
]*>)((?:.(?!?div))*.)*?)#is",$str,$matches);
print_r($matches);
请教一下,是不是PHP 不支持组平衡啊
------解决方案--------------------
"#((?'open']*>)((?:.(?!?div))*.)*?)((?:'-open'