Berkani and Sarihr [Studia Math. (2001) 148: 251–257] showed that the set of all Drazin invertible elements in an algebra over a filed is a regularity in the sense of Kordula and M¨ uller [Studia Math. (1996) 119: 109–128]. In this paper, the above result is extended to the case of a ring. Counterexamples are provided to show that the set of all generalized Drazin invertible elements in a ring need not be a regularity in general. We determine when the set of all generalized Drazin invertible matrices in the 2 × 2 full matrix ring over a commutative local ring is a regularity. We also give a sufficient condition for the set of all generalized Drazin invertible elements in a ring to be a regularity