Skip to content

Instantly share code, notes, and snippets.

@pecuchet
Created August 3, 2020 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pecuchet/86ff2a1d3c0807c3253b018d7c6bd105 to your computer and use it in GitHub Desktop.
Save pecuchet/86ff2a1d3c0807c3253b018d7c6bd105 to your computer and use it in GitHub Desktop.
A collection of js regular expressions.
// Password validation
const length = 12,
pattern = `^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[*!$€£#%&|_\\-@"'(§^¨{})\\[\\]´\`~+=:;,.?<>]).{${length},}$`,
regex = new RegExp(pattern);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment