Let's rename this `nextMatch`. `getQuery` has a connotation that you are doing a direct lookup and should return the same value every call given the same arguments, vs searching through a buffer.