【发布时间】:2016-09-07 21:21:15
【问题描述】:
我有这个验证:
'users.first_name' => 'required|min:2|regex:/[A-Za-z. -]/|max:255',
为什么这个验证会通过这个名字:John[][]
【问题讨论】:
-
请给我们minimal reproducible example,以便我们重现您的问题
-
@lonVasile 你需要在
first_name中允许什么?? -
任何字母、点和破折号。
-
试试
'users.first_name' => 'required|regex:/^[A-Za-z. -]{2,255}$/'