$zz = '/this\b/';
$string1 = "this is a apple";
$string2 = "thisis a apple";
$string3 = "thisartrapple";
if (preg_match($zz, $string3, $matches)) {
echo '匹配到了,结果为:';
var_dump($matches);
} else {
echo '没有匹配到';
}
?>
php
this后面加个空格,或者thisartrapple改为artrapplethis
this后面加个空格,或者thisartrapple改为artrapplethis