I want a regular expression to check that:
A password contains at least eight characters, including at least one number and includes both lower and uppercase letter
Use this,
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%?=*&]).{8,20})
It will validate for at least one lowercase, one upper case, one number and the special charecters of (!,@,#,$,%,?,=,*,&).
Minimum length is 8 and maximum length is 20