regex for validating password
This regex can be use to validate password
1
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W]).{8,20})
Copied!
description:
1
( # Start of group
2
(?=.*\d) # must contains one digit from 0-9
3
(?=.*[a-z]) # must contains one lowercase characters
4
(?=.*[\W]) # must contains at least one special character
5
. # match anything with previous condition checking
6
{8,20} # length at least 8 characters and maximum of 20
7
) # End of group
Copied!
Last modified 1mo ago
Copy link