1. A method for encoding a plurality of key matching rules grouped in a chunk, each of the key matching rules beginning with a header and having at least one dimension, the method comprising: in a rule encoding engine, communicatively coupled to memory and provided with a chunk of key matching rules, building a multi-rule corresponding to the chunk comprising: storing in the memory a multi-rule header of the multi-rule, the multi-rule header representing, collectively, a plurality of headers stored one after the other, the multi-rule header being decoded by a rule matching engine in a single decode operation to extract the plurality of headers of the key matching rules, wherein the plurality of headers include values which control the rule matching engine processing of the key matching rules, including dimensions, the rule matching engine formats the key matching rules based on a key and matches the key matching rules against the key to find a match based on the values stored in the plurality of headers.