Disappointed and needing help

I'm very embarrassed to say but I cheated on my boyfriend while he was away. We had been arguing and hadn't been able to see each other for months because of his job. A week before he came home I hooked up with and ex but had my period two days later. Had sex for the firs time ever with my bf the day after my period went off and now I'm pregnant. Is there a chance even though I had my cycle that my ex could father my child.? Please help I'm so disappointed and confused.