Yunus bin Jubayr (may Allah have mercy on him) said: I asked Sayyiduna Abdullah bin Umar (may Allah be pleased with him): "A man divorced his wife while she was menstruating (what is the ruling)?" He said: "Do you know Ibn Umar?" I said: "Yes." He said: Sayyiduna Abdullah bin Umar (may Allah be pleased with him) divorced his wife while she was menstruating, so Sayyiduna Umar (may Allah be pleased with him) came to the Prophet (peace and blessings be upon him) and asked him, and he (peace and blessings be upon him) commanded him to take her back and then to divorce her at the start of her waiting period. I said: "Will that divorce be counted?" He said: "Yes." He said: "What do you think, if he was helpless or acted foolishly?"
(b) Al-Bukhari recorded it from Hajjaj bin Minhal, except that he said: I said: "Is that divorce counted?" He said: "What do you think, if he was helpless and acted foolishly?"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 14918