Format and length validation