checking for the validity of characters 5 -- 34