Just as importantly, regret is an emotion similar to any other. It is a backward-looking emotion with a sprinkle of forward-looking desire and hope. You regret not having done something in the past because of the possible future ramifications that would have entailed in your present or future life, which you hope would be better, whatever that means for your life in your thinking brain. In truth, regret merely is. It is a signal that you may have considered other options in a past decision you made or did not make.
You would have never known the outcome of the option not taken, which is why you can regret it—because you feel the inherent soul-crushing pressure of the universal uneasiness of existence, and you wish for a better place to be. In fact, that better place may not exist. Hope is fear in disguise; a seeming belief that if only you had done X, you would be in a better situation today or tomorrow. Such thought is abstract and counterproductive, I would argue. Ruminating about the past, or hoping about the future is nothing but a thought in the present. As any thought does, it rises and passes away, leaving space for more thinking.