Jealously is a funny, fickle thing. I am very happy in my marriage, as in I know in every cell in my body that my husband is the man for me. The end.
But, before I met him I had a few suitors, you could say. Some who I keep in touch with - entirely platonic and open with my husband. Heck, he's even made friends with some of them. But there have been moments... One moved across the country, got a great job, got married a few years ago (and honestly the whole day it kept popping into my mind.) Now he's even got a beautiful 2 year old daughter and really seems happy himself.
And every now and then I get this stinging thought "What if...?" And for a minute or two my mind wanders off to those alternate realities. I know it's crazy and when I think about it, I'm glad we ended up where we did. Me with mine, him with his. But even years later I still think about him and his wife and baby with a pang of jealousy, then I stifle it by focusing on all the ways my husband was the perfect choice for me.
I told my little shameful anecdote because I think it's entirely human to have these thoughts. You had some sort of connection with this woman, whatever it was. Even when it's over or maybe,
especially when it is over, it's perfectly natural to take a moment now and then and dwell on that big "What if?"
The key is to learn to let go of that and move on. It is
not to dwell for so long that the jealousy eats at you. Beware also of that insidious guilt. You know it's "wrong" to pine for another, even just a little, and sometimes the sense of guilt and shame, the "I shouldn't feel this way," can make you obsess and ruminate even more. That's no good. It's just a waste of your time and emotion to internally flagellate yourself for a brief lapse in emotional solidarity. It happens. You're human. Accept it and move on.
So when I find myself doing it, I say a little prayer for the other person, that their life goes well and they find happiness. I think of my spouse, in detail

, and focus on all of his positive traits, how my life is better with him, why I chose him, all the reasons why I still choose him. Then I smile a little at the secret thought I had, shrug it off, and get on with my life, right here in the present.
Again, I think its natural to feel the way you do, the trick is to remain solidly in the present and not to let those feelings drag you down into those dark rabbit holes for long. Consciously bring yourself back to the present and focus on the good you have right now.