Are these regrets anything you can go back and fix? If you can't change whatever happened then it's taking your time and energy that you need to enjoy the present or future. Is there an OCD component to this? If so, medication could help you.
If not, every single time a regret thought comes up, immediately and deliberately replace it with a positive thought or memory. This is building new neural pathways in your brain and eventually these new pathways will be stronger then the old regret pathways. Good luck and best wishes.