State machines used to order and select matching operations for determining whether an input string matches any of at least one
regular expression are configured by (1) accepting the set of
regular expression(s), and (2) for each of the
regular expression(s) of the set accepted, (A) identifying any look-ahead type strings within the given regular expression, (B) identifying any sequential type strings within the given regular expression, (C) partitioning the regular expression based on any identified simple strings, any identified look-ahead
type variable strings, and any sequential
type variable strings to generate partitioned parts of the given regular expression, (D) reordering the partitioned parts of the given regular expression using optimization policies to generate reordered partitioned parts of the regular expression, and (E) configuring nodes of a state
machine corresponding to the given regular expression, by recording configured information of the nodes on a tangible storage medium, using (i) an order of the reordered partitioned parts of the regular expression, and (ii) a string type of the partitioned parts of the regular expression. Once configured, the state machines may accept an input string, and for each of the regular expression(s), check for a match between the input string accepted and the given regular expression using the configured nodes of the state
machine corresponding to the given regular expression. Checking for a match between the input string accepted and the given regular expression using configured nodes of a state
machine corresponding to the given regular expression by using the configured nodes of the state machine may include (1) checking detection events from a simple string
detector, (2) submitting queries to identified modules of a variable string
detector, and (3) receiving detection events from the identified modules of the variable string
detector.