Can't help you with this; I'll just say life is a lot more than your job. So any "life advice" would be unrelated to being a software engineer or whatever.
> helping people by writing software
"Software" itself is just kind of like a building material; there's a very large number of ways you can apply it and things you can build with it. If you're more interested in "doing something meaningful/useful by writing software" than in "writing software to do something meaningful/useful", then you'll have to change the perspective a bit and actively look for it.
> happy
I wouldn't really know. Maybe the instances where I found something I wrote being used and liked by a user and being helpful to them, even if in a small way.
There have also been a couple of times where I built something which had some element of "fun" in the code itself. These do bring a certain happiness, but it's temporary, usually brief, and looking back it tends to sound silly and pointless. Some silliness and inconsequential fun is probably very good for your life, but it won't provide long term satisfaction on its own.
> regret
Yeah, some. But don't let regrets guide your life. They'll make you miserable.