A generalized Jacobian criterion for regularity