To wish that something could have been different in the past, because the outcome is bad.
Example: He regretted that he never told her that he loved her before she got married to someone else.
A wish that something could have been different because what actually happened is not good.
Example: He was filled with regret that he had walked down that dark alley that night. If he hadn’t, maybe he would still have his wallet.