There are commercials on TV stations that feature classic reruns. How do they put these together?

For instance, I saw one last night that started out with Henry Winkler doing his famous Fonzie "He-y-y-y". Then there were clips from many other old show with other actors using a similar expression; "MASH", "Gomer Pyle", etc. Are these old shows somehow indexed so a producer can search for specific bits like this? Or do some people have an encyclopedic knowledge of the old shows and can easily find these? Or do people just watch them and make notes of excerptable moments like that to make limited indexes they can use?

ANDRE L2021-03-18T22:40:15Z

Yes to all three methods that you listed.

LadyMerton2021-03-17T20:49:31Z

Computers have programs for this type of search and editing and have for a while now.  

Steve Guy2021-03-17T19:03:56Z

I don't know, but there are lots of TV channels that do ads like this. I've seen it done with shows like saved by the bell, full house and even all the star trek shows. My guess is that a team goes through and decides on the best clips to use, maybe they already have some in mind and then they write the commercial around the clips.