Regret is similar to guilt in that it is an anxiety emotion, but it is more often self-administered or realized, as opposed to being dispensed by others or by the public, as guilt is.
Regret can form self-correction morally, and in so doing, fills us up with more conscience (ethics) and or intuition (shrewdness), from our lessons learned.
Its most unique feature is that it is directly caused by the lack of the mature character skill called, "Observing Ego," in which one who has this core virtue of personal growth, may see the right things to say or do, and then do them, rather than failing in attention to the social circumstances, and then make mistakes of decision-making or action.
When we lack Observing Ego, we often have regrets.
When we employ Observing Ego, even if we fail to get to goals, we have "done our best," and so have no regrets.