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

哎,求2个正则合并成一个正则如何写啊多谢

2024/2/20 4:09:55发布14次查看
哎,求2个正则合并成一个正则怎么写啊,谢谢
本帖最后由 cluonani 于 2013-05-13 14:40:09 编辑 这是要匹配的内容
primary color:
multi-color
multi pack indicator:
no
battery type:
does not contain a battery

这个个正则,怎么合并成一个啊
$a = preg_match_all('/lightrowhead.*?>(.*?):.*?lightrow.*?>(.*?)(.*?):.*?darkrow.*?>(.*?)(.*?):.*?[lightrow|darkrow].*?>(.*?)(.*?)', $content, $lightrowhead);
不想加入向前引用的话可写作
$a = preg_match_all('/(?:lightrowhead
------解决方案--------------------
darkrowhead).*?>(.*?):.*?(?:lightrow
------解决方案--------------------
darkrow).*?>(.*?)', $content, $lightrowhead);
需要前后配对的话可写作
$a = preg_match_all('/(lightrow
------解决方案--------------------
darkrow)head.*?>(.*?):.*?\\1.*?>(.*?)', $content, $lightrowhead);
该用户其它信息

VIP推荐

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