Hi, please correct if I have this wrong but I think you are saying:
March 3 -- Sex with ex
March -- Sex with husband throughout month
March 24-29 -- Period
April -- Sex with husband throughout month
April 18-23 -- Period
April 26 -- Sex with ex
May 8 -- positive pregnancy test
I assume you are saying the sex with the ex on April 26 was unprotected?
Got a couple of questions for you.
1. The timing between your two periods is 25 days. Are your menstrual months usually that short? And if so, are they regular (like always 25 days on the dot) or are they irregular? This goes to the question of whether you might have been ovulating on April 26 or within range of it (if the sex was unprotected, his sperm could last in your body for about 5 or 6 days). Did you also have sex with your husband around the April 26 date and later, i.e., after your April period ended? (It wasn't just the time with your ex after your period in April until you found out you were pregnant, right?)
2. Do you want the baby to be from your ex? It's an unusual pattern, to have sex with one's ex at widely spaced intervals, unless that is signalling that the person is not really into their marriage.
Anyway, it is possible that sex on or around the 26th produced the pregnancy if your menstrual month is always this short. Of course, it is also quite possible the baby is from your husband if you did have sex with him after your period ended in April. What you need to do is find out from an ultrasound when your estimated due date might be, in hopes of ruling the 26th out as possibly too early (though, hate to say, it probably is not too early).
Go to your doctor and tell him or her that you're pregnant but either say you don't remember the first day of your last period or else say your periods are so irregular that you don't want that date to be used to begin the pregnancy count. Tell him you would like an ultrasound as early as possible (next week would be really good) and ask them not to use your last period date but only the baby's measurements and developmental markers to try to decide your estimated due date. Don't just get a "weeks pregnant" count, you need the estimated due date from an ultrasound measurement. (Not just looking on a calendar or using a little wheel.)
When you get your estimated due date, go home and plug it into an online conception calculator, or just count backwards on a calendar 266 days, and that will give you an estimated conception date.
If it says you conceived after about May 3, then the baby is most likely from your husband. If earlier than that, you sure can't rule out your ex.