Naive implementation of macro and substring searching