Ikrimah narrates from Sayyiduna Abdullah bin Abbas (may Allah be pleased with him) that Sayyiduna Ibn Mas'ud (may Allah be pleased with him) did not say this, and if he did say it, then it is a slip of a scholar, concerning a man who says: "If I marry so-and-so, she is divorced." Allah Almighty says: "O you who believe, when you marry believing women and then divorce them before you have touched them" [Surah al-Ahzab: 49]; Allah did not say: "When you divorce believing women and then marry them."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 14887