Patent ID: 8015208

Claim:
A system for analyzing a data stream in order to match at least a portion of the data stream with a regular expression comprising at least a first subexpression and a second subexpression, the system comprising: a storage device storing a state machine comprising a first terminal state indicative of locating a first subexpression and a second terminal state indicative of locating a second subexpression, wherein a regular expression comprises each of the first and second subexpressions and defines a required relationship between the first and second subexpressions, wherein the storage device further stores a template comprising relationship information indicating the required relationship between the first and second subexpressions, as indicated in the regular expression; a processing engine configured to receive a data stream and apply the state machine to the data stream, wherein upon reaching the first or second terminal state the processing engine initiates recordation of tokens comprising information regarding the respective first or second subexpressions; and a post processing module configured to access the recorded tokens and the stored template, wherein the post processing module determines if the information of the recorded tokens matches the relationship information indicated in the template, wherein matching of the recorded tokens to the relationship information indicates location of the regular expression including both of the first and second subexpressions in the data stream.