I want my user password have the rule like:
- at least one alphabet, at least one number.
- can include special characters (almost all special characters in keybord)
- length more than 8.
this is my regular expression
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d!"#$%&'()*+,-.\/:;<=>?@[\]^_`{|}~]{8,}$/
but it does not match the back slash . for example ,the password "3e5t1qa2w\" will fail.
I use laravel(php framework) validation ,so the full code is this:
'password' => array(
'sometimes',
'required',
'between:8,32',
'regex:/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d!"#$%&\'()*+,-.\/:;<=>?@[\]^_`{|}~]{8,}$/'
),
and this one which use two back slash doesnot work too.
Does someone knows why?