15. A computer software product for string matching, the product comprising a computer-readable medium in which program instructions are stored, which instructions, when read by a computer, cause the computer to accept an input regular expression comprising one or more nested references to respective referenced regular expressions, to replace the nested references in the input regular expression with the respective referenced regular expressions, so as to provide a modified regular expression that does not contain a reference to another regular expression, and to match the modified regular expression to a target string.
17. The product according to claim 15 , wherein the instructions cause the computer to store a cached regular expression corresponding to a first occurrence of a nested reference, and to replace a second occurrence of the nested reference, subsequent to the first occurrence, with the cached regular expression.