Validation for passwords

In this post, we’ll see five types of password validations so we can give more
confidence to the users towards the security of their credentials. To apply it, it is
necessary to do it by the RejexTest function, which is located in logic.

Minimum 8 characters, at least one letter, and one number:

^(?=.[A-Za-z])(?=. \d)[A-Za-z\d]{8,}$

Minimum 8 characters, at least one letter, one number, and one special character:

^(?=.[A-Za-z])(?=. \d)(?=.[@$!% #?&])[A-Za-z\[email protected]$!%*#?&]{8,}$

Minimum 8 characters, at least one uppercase letter, one lowercase letter, and
one number:

^(?=.[a-z])(?=. [A-Z])(?=.*\d)[a-zA-Z\d]{8,}$

Minimum 8 characters, at least one uppercase letter, one lowercase letter, one
number, and one special character:

^(?=.[a-z])(?=. [A-Z])(?=.\d)(?=. [@$!%?&])[A-Za-z\[email protected]$!% ?&]{8,}$

Minimum 8 characters and maximum 10, at least one uppercase letter, one
lowercase letter, one number, and one special character:

^(?=.[a-z])(?=. [A-Z])(?=.\d)(?=. [@$!%?&])[A-Za-z\[email protected]$!% ?&]{8,10}$