Use efficient index-based file name matcher, courtesy of @kevinsawicki.