Fixed regex based input validation.