您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

嵌套正则写法,该怎么解决

2024/5/5 18:47:14发布31次查看
嵌套正则写法
php code$string = some text (a(b(c)d)e) more text; if(preg_match(/\((?>[^()]+|(?r))*\)/,$string,$matches)) { echo ; print_r($matches); echo
; }
上面是网上找到的嵌套正则写法,把string改成:
$string = 'some text
cde more text';
改成这样后,正则规则我换不过来了,亲大虾帮忙改一下。
最好能做到个数不确定的嵌套匹配
------解决方案--------------------
php code\w+|(?r))*/,$string,$matches) && print_r($matches);

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product