Let Γ be a graph with vertex set V , and let a and b be nonnegative integers. A subset C of V is called an (a, b)-regular set in Γ if every vertex in C has exactly a neighbors in C and every vertex in V \ C has exactly b neighbors in C. In particular, (0, 1)-regular sets and (1, 1)-regular sets in Γ are called perfect codes and total perfect codes in Γ, respectively. A subset C of a group G is said to be an (a, b)-regular set of G if there exists a Cayley graph of G which admits C as an (a, b)-regular set. In this paper we prove that, for any generalized dihedral group G or any group G of order 4p or pq for some primes p and q, if a nontrivial subgroup H of G is a (0, 1)-regular set of G, then it must also be an (a, b)-regular set of G for any 0 a |H| − 1 and 0 b |H| such that a is even when |H| is odd. A similar result involving (1, 1)-regular sets of such groups is also obtained in the paper.