If you have intercourse two days before your period, you will not get pregnant because you have already ovulated at this time, and the survival time of the egg is relatively short, usually 24 hours without fertilization will die, so the egg has already died at this time, and you will not get pregnant without taking contraceptive measures. If your period is irregular and you think you are about to have your period two days before your last period, it is possible to get pregnant because once your menstrual cycle is irregular, it is difficult to know when you are ovulating, so when you think it is safe, you may be ovulating, so it is possible to get pregnant. For women with irregular periods, it is recommended to take contraceptive measures during intercourse, either by using condoms or by taking oral emergency contraceptive pills within 72 hours after intercourse.