标签: php regex preg-match
preg_match说我错过了一个括号。但是哪里? :(
preg_match('/^(Lam)\/(\d+)\.(\d+) \(Trent/', $string, $matches)
答案 0 :(得分:0)
这可能是正则表达式中反斜杠的问题。请尝试使用以下代码:
<?php // Notice the double backslashes preg_match('/^(Lam)\\/(\d+)\\.(\d+) \\(Trent/', $string, $matches)