i want to validate password in c programming with below rules.
at least one uppercase word
at least one lowercase word
at least one number
at least one symbol (!@#$%^&*)
length: 8 - 32
how can I do that with regex or without it?
i want to validate password in c programming with below rules.
at least one uppercase word
at least one lowercase word
at least one number
at least one symbol (!@#$%^&*)
length: 8 - 32
how can I do that with regex or without it?
You could try the below regex to satisfy all of your requirements,
^(?=.{8,32}$)(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[(!@#$%^&*)]).*
^(?=.{8,32}$) - length: 8 - 32
(?=.*?[A-Z]) - at-least one uppercase letter.
(?=.*?[a-z]) - at-least one lowercase letter.
(?=.*?[0-9]) - at-least one number.
(?=.*?[(!@#$%^&*)]) - at-least one symbol present inside the character class.
.* - Match any character zero or more times only if all the above 5 conditions are true.