TITLE: Is the set of regular points in a scheme open in general?
QUESTION [5 upvotes]: In the situation when smooth/k coincides with regularity (for a finite-type k scheme edit: k also perfect, thanks Remy), I think this should be true (?). But I am not sure about the situation for a general scheme. 
Maybe there is a scheme consisting only of singular (non-regular) points? Oh, there is, I think: $k[x]/x^2$. But this doesn't answer my question about openness.
By regularity I mean that local ring is a regular local ring, i.e. the dimension of the Zariski tangent space is the same as the dimension of the local ring.

REPLY [3 votes]: No. According to this mathoverflow post, there is an example of an affine Noetherian integral scheme of dimension 1 whose regular locus is not open, see Exposé XIX of the volume "Travaux de Gabber" in Astérisque 363-364.
See comments by Remy and Rieux for nice sufficient conditions for the regular locus to be open.