Skip to content

Instantly share code, notes, and snippets.

@Solomko2
Created April 24, 2018 09:21
Show Gist options
  • Save Solomko2/6adc2def5cf62fa991ccec0bb0ca5b25 to your computer and use it in GitHub Desktop.
Save Solomko2/6adc2def5cf62fa991ccec0bb0ca5b25 to your computer and use it in GitHub Desktop.
Minimum eight characters, at least one letter and one number
// Minimum eight characters, at least one letter and one number:
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$"
// Minimum eight characters, at least one letter, one number and one special character:
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$"
// Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"
// Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
// Minimum eight and maximum 10 characters, at least one uppercase letter, one lowercase letter, one number and one special character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,10}"
@naimurhasan
Copy link

Searched a lot finally found something ^(?=good)(?=useful)(?=easy to understand)(?=can modify)$.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment