/^[^%\s]{8,}/
Demo website:
https://smuger.github.io/HireRightPassword-Problem/
Accept | Deny |
---|---|
12345678 | %2345678 |
qwertyui | 123%5678 |
function isValidLength(input) {
var reg = /^[^%\s]{8,}/;
return reg.test(input);
}
Change regex to /^[^\s]{8,}/ or Add a note that you cannot use %