Medium Strength Password
beginnerValidates passwords with at least 6 characters, one letter and one digit.
passwordvalidationsecurity
Pattern
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$/Try It
0 of 7 strings matched
Explanation
Uses two positive lookaheads to require at least one letter and one digit. Matches 6 or more alphanumeric characters from start to end.
Test Strings
Matching
- abc123
- Test99
- hello1world2
Non-matching
- abcdef
- 123456
- ab1
- !!!!!!
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Not supported (RE2 engine) |
Code Snippets
const regex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$/;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);