I've given some thought to regret and guilt (which is a form of regret). It seems to me that it occurs when someone's values change, and they evaluate a past decision by criteria different from the criteria present at the time the decision was made.
I know that sounds obvious.
I am now a vegetarian, for ethical reasons. I was not always a vegetarian. Looking back, in a sense, I regret having eaten meat so many times. That is to say that while at the time I valued eating meat highly and didn't value vegetarianism at all, I now value vegetarianism over eating meat, and thus now what was good-to-me has become bad-to-me.
I am not more right now than I was before; such an evaluation cannot be made. And when I look back and evaluate, "That was wrong," I am making a statement about my perception of it now, not the action then. When I say, "That was wrong," what I'm really saying is, "That (the past action) is wrong-to-me now."
That's a very gradual change of values, of course. A far more sudden change of values can be found in desire and sated desire. I may be on a diet and value the diet and value weight loss, but I'm very hungry, so I'm also valuing highly a Snickers bar. If I value the Snickers bar over the weight loss, I will eat the Snickers bar. However, in eating the Snickers, I sate my hunger, it diminishes greatly, and I'm left in a situation where I value weight loss far more than I value the action of eating the Snickers bar. Looking back, I regret eating it. In other words, I evaluate the past action as bad.