1. A method of recognizing a specified group of patterns in a data stream, the method comprising: identifying a rule for said specified group of patterns in the data stream; using a first array of finite state machines to scan the data stream for at least some of the patterns in the specified group; for patterns in the specified group that are found in the data stream by the first array of finite state machines, sending pattern identifiers to a second array of finite state machines; and the second array of finite state machines determining if the specified group of patterns is in the data stream in accordance with the identified rule by, at least in part, using said pattern identifiers.