Regret is a side effect of the memory system.
There are many effects of helplessness.
When love is helpless people feel sweet sorrow.
People feel sweet sorrow when they feel love but cannot act on it, or they don't feel love's effect. For example, a person is with their dear one but they cannot do anything because the love is one-sided, or when a mother does something for her child but the child's response is cold.
Sweet sorrow appears when love and helplessness occur simultaneously.
When a person's sense of helplessness is too big they often commit suicide.
Humans don't commit suicide because of how sad they feel. Helplessness is the cause of suicide. They think that no matter whether they live or die there is no difference because they think that their existence has no influence. Say a TV star commits suicide and then a fan commits suicide because of this. The fan committed suicide not because they felt too sad, but because they felt a strong helplessness from not being able to stop the TV star's death.
In addition, there are many suicides by anger, such as suicides by fire to protest against the government, and some cases of suicide caused by bullying. They claim, "It's your fault I'm dead."
Even if we set aside these extreme cases helplessness has elements which cause people distress. Regret is one of the best representatives.
Regret is to recall past events and to find hope in that situation. They notice what they could have done to succeed. Then they realize that they cannot correct past events─ of course!─, so they feel helpless and depressed.
However, time is the wrong opponent to fight because all people are helpless against the flow of time. People might think, "If I had known that at the time it wouldn't be like this," but they cannot avoid it because they didn't know. This misunderstanding is because they cannot see the past as the past, and confuse the past and present. Regret is a side effect of memory.
Regret should be clearly distinguished as a measure to not repeat the same mistake when similar events happen in the future.