An apparatus, a carrier medium carrying computer readable code to
implement a method, and a method for searching for a plurality of
patterns definable by complex expressions, and further, for efficiently
generating data for such searching. One method includes accepting or
determining a plurality of state machines for searching for a plurality
of patterns, merging the state machines to form a merged state machine,
and storing a data structure describing the merged state machine,
including state data on the states of the merged state machine. The
method is such that pattern matching logic reading state data and
accepting a sequence of inputs can search the input sequence for the
plurality of patterns.