11. The system of claim 9 , wherein the NFA comprises an initial state and a number of intermediate states between the initial state and the match state, and wherein the match state of the NFA corresponds to an initial state of the reverse NFA.
9. A system for determining lengths of one or more substrings within an input string of characters that matches a regular expression embodied by a non-deterministic finite state automaton (NFA), comprising: a search engine configured to compare the input string with the regular expression to identify a match string that contains the one or more substrings that match the regular expression; an inversion circuit coupled to the search engine and configured to invert the match string to create a reverse match string; a reverse search engine configured to compare the reverse match string with an inverted regular expression that embodies a reverse NFA; and a counter circuit coupled to the reverse search engine and configured to increment a count value upon each compare cycle in the reverse search engine, wherein the counter circuit outputs the count value each time a match condition is detected in the reverse search engine.