I don't know your personal circumstances, but I do know that there are roles for mathematicians to play in many areas outside of academia, and that your age wouldn't preclude these possibilities. If you haven't already, there would be no shame in beginning a PhD at your age (even some successful academics have done so).
We are all lucky and unlucky relative to someone else. I think time used on regret or "longing for what could have been" is simply time misspent, much like you might regard your childhood. Best of luck overcoming this natural tendency.
Life is nothing but an inevitable race to the end. I try to take it slow and steady. Having some regrets is unavoidable! But it makes stories like this all the more sweet. Not all of us had the same chances but someone made it through and that brings a smile to my face.
We are all lucky and unlucky relative to someone else. I think time used on regret or "longing for what could have been" is simply time misspent, much like you might regard your childhood. Best of luck overcoming this natural tendency.