Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:2507Abū Maʿn al-Raqāshī > ʿUmar b. Yūnus > ʿIkrimah / Ibn ʿAmmār > Isḥāq Wahū Ibn ʿAbdullāh b. Abū Ṭalḥah > Anas

I think (he also sought forgiveness) for the children of the Ansar and the slaves and the freed men of the Ansar. I have no doubt about it.  

مسلم:٢٥٠٧حَدَّثَنِي أَبُو مَعْنٍ الرَّقَاشِيُّ حَدَّثَنَا عُمَرُ بْنُ يُونُسَ حَدَّثَنَا عِكْرِمَةُ وَهُوَ ابْنُ عَمَّارٍ حَدَّثَنَا إِسْحَاقُ وَهُوَ ابْنُ عَبْدِ اللَّهِ بْنِ أَبِي طَلْحَةَ أَنَّ أَنَسًا حَدَّثَهُ

أَنَّ رَسُولَ اللَّهِ ﷺ اسْتَغْفَرَ لِلأَنْصَارِ قَالَ وَأَحْسِبُهُ قَالَ وَلِذَرَارِيِّ الأَنْصَارِ وَلِمَوَالِي الأَنْصَارِ لاَ أَشُكُّ فِيهِ  


See similar narrations below:

Collected by Ḥākim, Ibn Ḥibbān
hakim:5766al-Imām Abū al-Walīd And ʾAbū Bakr b. Abū Fudayk > Ibn Abū Ḥabībah > ʿAwf b. Salamah b. ʿAwf b. Salamah b. Salāmah b. Waqsh from his father from his grandfather

that the Messenger of Allah ﷺ said: "O Allah forgive the Ansar and the children of the Ansar, and the children of the children of the Ansar, and the women of the Ansar." (Using translation from Tirmidhī 3909)   

الحاكم:٥٧٦٦أَخْبَرَنِي الْإِمَامُ أَبُو الْوَلِيدِ وَأَبُو بَكْرِ بْنُ أَبِي فُدَيْكٍ حَدَّثَنِي ابْنُ أَبِي حَبِيبَةَ عَنْ عَوْفِ بْنِ سَلَمَةَ بْنِ عَوْفِ بْنِ سَلَمَةَ بْنِ سَلَامَةَ بْنِ وَقْشٍ عَنْ أَبِيهِ عَنْ جَدِّهِ

أَنَّ النَّبِيَّ ﷺ قَالَ «اللَّهُمُ اغْفِرْ لِلْأَنْصَارِ وَلِأَبْنَاءِ الْأَنْصَارِ وَلِمَوَالِي الْأَنْصَارِ»  

ذِكْرُ دُعَاءِ الْمُصْطَفَى ﷺ بِالْمَغْفِرَةِ لِذَرَارِيِّ الْأَنْصَارِ وَلِمَوَالِيهَا

ibnhibban:7282Aḥmad b. al-Ḥasan b. ʿAbd al-Jabbār al-Ṣūfī > ʿAbdullāh b. al-Rūmī > al-Naḍr b. Muḥammad > ʿIkrimah b. ʿAmmār > Isḥāq b. ʿAbdullāh b. Abū Ṭalḥah > Anas b. Mālik

[Machine] The Messenger of Allah ﷺ said, "O Allah, forgive the Ansar and the children of the Ansar, and the children of the children of the Ansar, and the supporters of the Ansar."  

ابن حبّان:٧٢٨٢أَخْبَرَنَا أَحْمَدُ بْنُ الْحَسَنِ بْنِ عَبْدِ الْجَبَّارِ الصُّوفِيُّ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ الرُّومِيِّ حَدَّثَنَا النَّضْرُ بْنُ مُحَمَّدٍ حَدَّثَنَا عِكْرِمَةُ بْنُ عَمَّارٍ حَدَّثَنِي إِسْحَاقُ بْنُ عَبْدِ اللَّهِ بْنِ أَبِي طَلْحَةَ حَدَّثَنِي أَنَسُ بْنُ مَالِكٍ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ «اللَّهُمَّ اغْفِرْ لِلْأَنْصَارِ وَلِذَرَارِيِّ الْأَنْصَارِ وَلِذَرَارِيِّ ذَرَارِيَّهُمْ وَلِمَوَالِي الْأَنْصَارِ»