<body>
<code class="php">$pattern = "/(abcd){1,2}.*(efgh){1,2}/";$string = "abcd123efgh456";preg_match_all($pattern,$string,$result);</code>
我这样写会吧abcd和efgh都放到result数组中,我希望把abcd别放到数组里,而把efgh放到数组里,这种pattern怎么写呢?
谢谢
回复内容:
本文@来#源gaodai$ma#com搞$$代**码网搞代gaodaima码 <body>
<code class="php">$pattern = "/(abcd){1,2}.*(efgh){1,2}/";$string = "abcd123efgh456";preg_match_all($pattern,$string,$result);</code>
我这样写会吧abcd和efgh都放到result数组中,我希望把abcd别放到数组里,而把efgh放到数组里,这种pattern怎么写呢?
谢谢
(?:abcd)