Disclosed is a method and system for multi-character multi-pattern pattern
matching. In the multi-character multi-pattern pattern matching method,
patterns in an input stream are detected by transitioning between states
of a "compressed deterministic finite state automaton (DFA)", with each
transition based on multiple characters of the input stream. The
compressed DFA is created by compressing an original DFA, such as an
Aho-Corasick DFA, such that each state of the compressed DFA represents
multiple consecutive states of the original DFA and each transition
between the states of the compressed DFA is a combination of all of the
transitions between the multiple consecutive states of the original DFA.
This method can be implemented using a Ternary Content-Addressable Memory
(TCAM) to store the transitions of the compressed DFA and compares the
transitions with multiple characters of an input stream at a time to
detect patterns in the input stream.