This is exactly what I meant in my previous comment - instead of one test, you have **four**!

1) Bad word?
2) Too long?
3) Too short?
4) Illegal char?

Good work.