I guess you just have to learn to be able to move on. Sure, sometimes things happen (or you actually do something) that doesn't go well. That's part of the process of life I'm afraid. You can't live in the past because things that have happened can't be undone. You just have to somehow reconcile with yourself to do better in the future and get on with doing just that.
Depends on how big the regret is. If it is minor, then I just shake it off, but if it were a big regret, then I'd probably not be able to deal with it very well. Fortunately I have had no big regrets in my life so far.