separate length and legal characters check