1. A method of compiling a pattern into a non-deterministic finite automata (NFA) graph, the method comprising: examining the pattern for a plurality of elements and a plurality of node types, each node type corresponding with an element, each element of the pattern to be matched at least zero times, the element representing a character, character class or string; generating a plurality of nodes of the NFA graph, each of the plurality of nodes configured to match with one of the plurality of elements, where the node indicates the node type corresponding to the element, a next node address in the NFA graph, a count value, and the element.