preg_match编译失败:缺少括号


preg_match compilation failed: missing parenthesis

preg_match说我缺少一个括号。但在哪里?:(

preg_match('/^(Lam)'/('d+)'.('d+) '(Trent/', $string, $matches)

这可能是正则表达式中反斜杠的问题。请尝试以下代码:

<?php
// Notice the double backslashes
preg_match('/^(Lam)''/('d+)''.('d+) ''(Trent/', $string, $matches)