Currently I'm attempting to create a regular expression to validate an user input field which requires the input to contain at least one of each of the following:
- an upper-case character
- a digit
- one of the following special characters:
& @ ! # +
I attempted to create a regular expression that will validate the input correctly:
/^([a-zA-Z+]+[0-9+]+[&@!#+]+)$/i.test(userpass);
However, the input is not validated correctly. How should I go about doing that?
+in each of those groups, why?