You are searching each line of the file for each of the searchstrings, capturing (and then discarding) the portion of the line preceding the searchstring, and then pushing the searchstring.
Your match is not greedy. You're just looking for a match on every line of every file. Get rid of the parenthesized portion of your pattern, and use a hash to keep track of what you've already matched.
Caution: Contents may have been coded under pressure.