  Let R be a unit-regular ring, and let a,b,c in R satisfy aba=aca. If ac and
ba are group invertible, we prove that ac is similar to ba. Furthermore, if ac
and ba are Drazin invertible, then their Drazin inverses are similar. For any
n\times n complex matrices A,B,C with ABA = ACA ,we prove that AC and BA are
similar if and only if their k-powers have the same rank. These generalize the
known Flanders' theorem proved by Hartwig.
