  We show, in a certain specific sense, that both the density and the
cardinality of a Hausdorff space are related to the "degree" to which the space
is nonregular. It was shown by Sapirovskii that $d(X)\leq\pi\chi(X)^{c(X)}$ for
a regular space $X$ and the author observed this holds if the space is only
quasiregular. We generalize this result to the class of all Hausdorff spaces by
introducing the nonquasiregularity degree $nq(X)$, which is countable when $X$
is quasiregular, and showing $d(X)\leq\pi\chi(X)^{c(X)nq(X)}$ for any Hausdorff
space $X$. This demonstrates that the degree to which a space is
nonquasiregular has a fundamental and direct connection to its density and,
ultimately, its cardinality. Importantly, if $X$ is Hausdorff then $nq(X)$ is
"small" in the sense that $nq(X)\leq\psi_c(X)$. This results in a unified proof
of both Sapirovskii's density bound for regular spaces and Sun's bound
$\pi\chi(X)^{c(X)\psi_c(X)}$ for the cardinality of a Hausdorff space $X$. A
consequence is an improved bound for the cardinality of a Hausdorff space.
