My requirement:
- One uppercase character
- One lowercase character
- One special character
- One digit
- 8 characters minimum
- Maximum 15 characters.
My regex is:
^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*]).{8,15}$
It takes all the characters, except $, *, ^.
= f.password_field: password, placeholder: "Password",:required=>'true',:class => "form-control password_text form-control",pattern:",:title=>'Min 8letters, one uppercase, lowercase letter, onedigit, one specialcharacter',:onchange => "form.confirm_pwd.pattern = this.value;"
= f.password_field: password_confirmation, placeholder: "Password",:class => "form-control form-control password_text",:required=>'true',title:"Please enter the same Password as above",:name=>'confirm_pwd'
When I turn on $and send, *and ^, it shows "Enter the same password as above" in the confirmation password field. If I include one #or another special character, it works well.
source
share