Skip to content

Instantly share code, notes, and snippets.

@Lcfvs
Last active May 26, 2016 15:15
Show Gist options
  • Select an option

  • Save Lcfvs/b1ee7c7c26d949e3ff7f to your computer and use it in GitHub Desktop.

Select an option

Save Lcfvs/b1ee7c7c26d949e3ff7f to your computer and use it in GitHub Desktop.
/*
matches a string which contains :
- min 8 chars
- a lowercase letter
- a capital letter
- a number
- a special char
- no chars repeated more than twice
*/
/(?=.{8,})(?=.*[A-Z].*)(?=.*[a-z].*)(?=.*\d.*)(?=.*[^a-z\dA-Z].*)(?=^((.)(?!\2{2}))+$)/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment