It's your ex boyfriend or ex girlfriend who you used to have a relationship with whether it was online in real life or if it included your sex life. Your not with your girlfriend/boyfriend so they're classed as your ex.
"Ahmed was my ex boyfriend.. I hate him"
"Jessica was my ex girlfriend I miss her"