Skip to content

Instantly share code, notes, and snippets.

@PetraMotz
Created August 4, 2021 12:05
Show Gist options
  • Save PetraMotz/8b5219338242fdcc99d9a404c4f244d7 to your computer and use it in GitHub Desktop.
Save PetraMotz/8b5219338242fdcc99d9a404c4f244d7 to your computer and use it in GitHub Desktop.
#fluid #regex
https://regex101.com/
^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$
This regex will enforce these rules:
At least one upper case English letter, (?=.*?[A-Z])
At least one lower case English letter, (?=.*?[a-z])
At least one digit, (?=.*?[0-9])
At least one special character, (?=.*?[#?!@$%^&*-])
Minimum eight in length .{8,} (with the anchors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment