Regular elements determined by generalized inverses