Regex for validate password in ReactJS

Viewed 13977

Can we do regex pattern checking for password validation in reactJS?

Since I am new to reactJS, I need regex pattern for validating the password.

Following are the conditions for validating password.

a) Password should contains one Capital letter

b) It should start with special character @ or #

c) It should not contain any vowel a,e,i,o,u letters

d) It should be alphanumeric.

e) Length of password should be between range 8 to 14

4 Answers

Standard one - /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/.test(paswrd)

Related