Let $X$ be a noetherian scheme and $f$ a rational function on $X$, so by definition the domain of $X$ includes all associated points of $X$. I think the following is true: $f$ is regular on $X$ if and only if it is regular along every associated point of every effective Cartier divisor on $X$.
I can prove this for $X = \text{Spec } A$ affine as follows: write $f = g/h$ for some $g,h \in A$ with $h$ not a zero divisor. If $f$ is not regular then $g \notin hA$, so in particular $g$ spans a nonzero submodule of $A/hA$, and we can take an irreducible component of its support. This is the desired associated point of the principal Cartier divisor $\{ h = 0 \}$.
So my claim is true affine-locally, but I'm not sure how to do it globally. That is, if $f$ is not regular, is it possible to construct an effective Cartier divisor on $X$ such that $f$ does not extend over one of its associated points?