1. A method for pattern matching, including: accepting at least one input sequence of symbols over an interface; accepting a specification of state transitions among states associated with a finite state automaton for matching an input sequence to one or more patterns, wherein one or more of the states are associated with state transitions corresponding to a deterministic finite automaton and one or more states are associated with state transitions corresponding to a non-deterministic finite automaton, and with at least one state transition between a deterministic finite automaton state and a non-deterministic finite automaton state; storing data that specifies the state transitions; and determining whether the accepted input sequence matches the pattern based on the stored data.