$pattern = "/(abcd){1,2}.*(efgh){1,2}/";
$string = "abcd123efgh456";
preg_match_all($pattern,$string,$result);

我这样写会吧abcd和efgh都放到result数组中,我希望把abcd别放到数组里,而把efgh放到数组里,这种pattern怎么写呢?
谢谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
(?:abcd)