PHP preg_match false匹配单引号

时间:2018-12-10 21:00:32

标签: php regex

谁能告诉我下面的代码为什么只匹配'It'而不是'It’s a me, Mario!'
最后的字符组不包含单个

$re = '/(todays saying is )(?:["“”„]*)(?P<quote>[^"“”„]+)(?:["“”„]*)/m';
$str = 'todays saying is “It’s a me, Mario!”.';

preg_match($re, $str, $matches);

var_dump($matches);

0 个答案:

没有答案