if !$2 || !$3 || $2 !isalnum || $3 !isalnum {
Is it really needed to use !$3? If there's no $2, why would there be a $3..?