Password Length Validation
beginnerValidates password length between 8 and 128 characters with any characters allowed.
passwordvalidationlength
Pattern
/^.{8,128}$/sTry It
0 of 6 strings matched
Explanation
Matches any string between 8 and 128 characters long. The dotAll flag (s) allows dots to match newlines. No character type restrictions.
Test Strings
Matching
- my-passphrase-is-long
- 12345678
- P@$$w0rd!
Non-matching
- short
- 1234567
- ab
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /^.{8,128}$/s;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);Common Variations
No spaces
^\S{8,128}$Rejects passwords containing whitespace