Sahih al-Bukhari 7244
Book 94: Wishes · Narrated by Abu Huraira
Arabic
حَدَّثَنَا أَبُو الْيَمَانِ، أَخْبَرَنَا شُعَيْبٌ، حَدَّثَنَا أَبُو الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " لَوْلاَ الْهِجْرَةُ لَكُنْتُ امْرَأً مِنَ الأَنْصَارِ، وَلَوْ سَلَكَ النَّاسُ وَادِيًا وَسَلَكَتِ الأَنْصَارُ وَادِيًا ـ أَوْ شِعْبًا ـ لَسَلَكْتُ وَادِيَ الأَنْصَارِ أَوْ شِعْبَ الأَنْصَارِ ".
English translation
Narrated Abu Huraira:Allah's Messenger (ﷺ) said, "But for the emigration, I would have been one of the Ansar: and if the people took their way in a valley (or a mountain pass), I would take the Ansar's valley or the mountain pass
Reference: Sahih al-Bukhari 7244, Book of Wishes. English translation by Dr. Muhammad Muhsin Khan.