"By the One besides whom there is no god, there is no surah in the Book of Allah but that I know where it was revealed, and there is no verse but that I know concerning what it was revealed. If I knew of anyone more knowledgeable of the Book of Allah than I am, and camels could reach him, I would ride to him."
والذي لا إله غيره ما من كتاب الله سورة إلا أنا أعلم حيث نزلت، وما من آية إلا أنا أعلم فيما أنزلت، ولو أعلم أحدا هو أعلم بكتاب الله مني، تبلغه الإبل، لركبت إليه.
Bukhari reported it in Fadail al-Quran (5002), and Muslim in Fadail al-Sahabah (2463), both through the route of Amash, from Muslim, from Masruq, who said, Abdullah said, and he mentioned it. This is the wording of Muslim, and the wording of Bukhari is similar.