Easiest would be to do a string search via the SQL database. you could do a wildcard search or whatever variation you needed. I would look into the View_CMS_Tree_Joined which is a pretty good cross section of content, and the CMS_PageTemplate table which should store all the templates including the master page. This each has either a content field or layout field where you could look for the right string in it.
You could also write something programmatically against the TreeProvider or DocumentEngine to grab this information and search, but if you are comfortable with SQL it would be the easiest way.