check that user is defined before regexp compare