I think they'd both become "regret". 后悔meaning is : you've done one thing in the past but you shouldn't have done or you think you shouldn't have done one thing .
遗憾 you didn't do this thing or you think it is imperfect for one thing .
Emm sorry my english level is terrible .hope you can understand !