Yes, it is safe to exercise using weights during pregnancy. It is tricky though so I would talk to your doctor. What is safe for one woman might be unsafe for another.
Like all physical activity it is a question of how much, how hard, how long and what does your doctor think. An easy walk done safely on a treadmill can be an excellent way to get exercise while...