Feeling down. Need advice.

Jess
So I used to work with this guy and we became really good friends. I left my job and we kept in touch. Mind you he has a gf. I would NEVER do anything to hurt someone else's relationship so ladies please understand that and try to feel where I am coming from. Anyways while we kept in touch he admitted to having feelings for me. I kept my distance because I respected his relationship. I confessed to having feelings for him as well. We were friends BEFORE the feelings developed. We continued to keep in touch as friends and were there for each other through some tough times. Some of these times being relationship issues with his gf. They were fighting a lot. Just recently I found out his gf is pregnant. I'm happy for him of course. I want the best for this person I care so much for. But I have to admit that deep down I feel sad because the feelings I have for him. I know I'm stupid for having these feelings because he's in a relationship but the heart wants what the heart wants. How do I get rid of this feeling? I have distanced myself a lot but I feel like it hurts more than what it helps. Just need some advice and/or kind words. Thanks ladies.