Actually, getting worms in pregnancy is so annoying, but please don't self-medicate with over-the-counter tablets yaar. Only your doctor can give you a safe medicine for this.
Oh god, I would be so terrified and anxious about how it affects the baby! Please don't search online or take any home remedy, just call your doctor right away to get the right treatment safely.
I panicked like crazy when I thought I had worms, thinking it would harm the baby! But my doctor gave me a safe solution and assured me it happens. Just consult your gynac, don't worry.