Saw a challenge on Twitter so I've been working my way through it, granted I am not the best with Regular Expressions. This is what I have so far:
var pass_regex = new RegExp(/^[a-z][A-Z][0-9]|[!@#$%^&*()_]+$/);
I am trying to match a password input that contains:
- 1 Lowercase Letter
- 1 Uppercase Letter
- 1 Digit OR Special Character
Where I am getting stuck is on the 'OR' part, I thought the pipe separator between [0-9] and my set of special characters would work but it doesn't seem to. Trying to better understand how you would use regular expressions to to check for 1 Digit OR 1 Special Character. Thank you in advance for any help provided.
passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && ( passwd.match(/0-9/) || passwd.match(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/) )