It is narrated from Abu Uthman (may Allah be pleased with him) that when the rulings on the waiting period of divorced women and of women whose husbands had died were revealed in Surah al-Baqarah, Ubayy bin Ka'b (may Allah be pleased with him) said: O Messenger of Allah! Some of the people of Madinah are saying: There certainly remain some women about whom nothing has been mentioned. The Messenger of Allah (peace and blessings be upon him) said: "Who are they?" Ubayy bin Ka'b (may Allah be pleased with him) said: Young girls, old women, and pregnant women. Abu Uthman (may Allah be pleased with him) said: Then this verse was revealed: "And those of your women who have despaired of menstruation, if you are in doubt, their waiting period is three months, and also of those who have not yet menstruated; and for those who are pregnant, their term is until they deliver their burden (that is, until the child is born)." [Surah al-Talaq: 4]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب العدد / 15379