← Back to challenges

RegEx Exercise 5: Password Validation

JavaScriptHardregexvalidation

Instructions

Create a regular expression that checks for a password:

  • It should contain at least one uppercase letter.
  • It should contain at least one lowercase letter.
  • It should contain at least one digit.
  • It should contain at least one special symbol.
REGEXP.test("bbA234c@cy~!")  ➞ true

REGEXP.test("32Bl4###xxz") ➞ true

REGEXP.test("!abcABC9lzD") ➞ true

REGEXP.test("d@!2?%^&ahaZbb") ➞ true

Notes

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.