我在 PHP 中试过这个:
<?php
$greets1="hello jack"; $greets2="hi john";
preg_match('/(hello)(?(1).*)/',$greets1,$result);
?>
我预计该数组$result包含helloand jack,但它只捕获hello. 为什么?
我在 PHP 中试过这个:
<?php
$greets1="hello jack"; $greets2="hi john";
preg_match('/(hello)(?(1).*)/',$greets1,$result);
?>
我预计该数组$result包含helloand jack,但它只捕获hello. 为什么?