Patent ID: 8413124

Claim:
A regular expression matching system, configured to match a received data packet by communicating with a regular expression compiling system, the regular expression compiling system comprising: at least one processor; a syntax analyzing module configured to analyze syntactic characteristics of a regular expression and send the regular expression to an appropriate compiler of at least two types of compilers according to preset syntactic rules and the syntactic characteristics of the regular expression; and the at least two types of compilers configured to receive the regular expression and compile the regular expression into a data structure of a specific form according to preset rules; and a category information library, wherein decision information generated by the syntax analyzing module is recorded in the category information library; wherein the regular expression matching system comprises: at least two types of matching modules, configured to match the received data packet according to the syntactic characteristics of the regular expression which the data packet is matched with and is compiled into the data structure of the specific form by the regular expression compiling system, wherein the at least two types of matching modules comprise a Deterministic Finite Automaton (DFA) adapter and a Perl Compatible Regular Expression (PCRE) adapter; and a mediating module, configured to search category information in the category information library using the generated decision information associated with the regular expression to determine which adapter will perform matching according to a search result; wherein, when the regular expression is compiled into a DFA transition table, the regular expression is sent to the DFA adapter; when the regular expression is compiled into a PCRE segment, the regular expression is sent to the PCRE adapter.