(a) Sayyiduna Anas bin Malik (may Allah be pleased with him) says: I never saw the Messenger of Allah (peace and blessings be upon him) as grieved and distressed as he was over the people of Bi'r Ma'unah and the expedition of al-Mundhir bin Amr. For a month he (peace and blessings be upon him) supplicated in the Fajr prayer against those who had martyred these Companions, and he (peace and blessings be upon him) would supplicate against Ri'l, Dhakwan, Usayyah and Banu Lihyan.
(b) Qatadah, Abd al-Aziz bin Suhayb, Abu Mijlaz Lahiq bin Humayd, Anas bin Sirin, Musa bin Anas and Asim bin Sulayman al-Ahwal (may Allah have mercy on them) all narrate from Sayyiduna Anas (may Allah be pleased with him) the word 'shahran' (for a month), meaning that he (peace and blessings be upon him) supplicated against them for one month.
(c) Malik bin Anas (may Allah have mercy on him) narrated it likewise from Ishaq bin Abdullah bin Abi Talhah (may Allah have mercy on him), from Sayyiduna Anas (may Allah be pleased with him), as thirty days; and Hammam (may Allah have mercy on him) narrates it via Ishaq (may Allah have mercy on him) as forty days.
(d) The narration of 30 days is the correct one.
(e) From Humayd al-Tawil (may Allah have mercy on him), via Sayyiduna Anas (may Allah be pleased with him), the story of the Uraniyyin is transmitted, that he (peace and blessings be upon him) supplicated against them in prayer twenty-five times and after that sent a detachment after them; these are two separate stories.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3095