Then was fulfilled what had been spoken by the prophet Jeremiah, saying, "And they took the thirty pieces of silver, the price of him on whom a price had been set by some of the sons of Israel..."
Matthew 27:9

This seems to be a quote of Zechariah, not Jeremiah, but some manuscripts only say "the prophet" and leave out the name. Surely Matthew knew the Scriptures well enough to know who said these words. It's possible that Jeremiah gave this same prophecy and it's not recorded, or Matthew might be using "Jeremiah" as a generic title for all the prophets. We do the same thing when we say, "According to Webster" or "Wikipedia says", although we know that Webster didn't write all the definitions in Webster's Dictionary and that Wikipedia didn't write any of the articles in their encyclopedia.