Below is my rule for password:
return [
'Password' => 'required|min:8|max:100|regex:[a-z{1}[A-Z]{1}[0-9]{1}]',
'Password_confirmation' => 'required|min:8|max:100|regex:[a-z{1}[A-Z]{1}[0-9]{1}]',
];
I am trying to add the rule such that it must have
- 至少一个小字符
- 至少一个大字符
- 至少一个号码
- 至少一个特殊字符
- min 8 chars
I tried this and it works required|confirmed|min:8|max:100|regex:/^[\w]{1,}[\W]{1,}$/
, on a regex tester software . but not sure why it does not work in Laravel
Am I missing something ?