Patent ID: 7093231
Filing Date: 2006-08-15
Classification: G06F,Y10S

Abstract:
1. A computer-implemented method of integrating side-effects into regular expressions, the method comprising the steps of: defining a built-in datatype, to represent any regular expressions, or regex composition, in such a way that a regular expression referenced by a variable of such datatype is immutable, and wherein the datatype facilitates composition using variables, and allows enforcement of strong type compatibility for regular expressions, such as when and where regular expressions can be used in the overall grammar of a programming language; defining a grammar for standard regular expression compositions, such as character-classes, string and character literals, a wildcard, repeats, iterates, concatenations, and unions; defining a grammar for general regular expression compositions that contribute side- effects; defining a grammar for expressing the particular side-effect of “capture”; defining a grammar for regex compositions in which side-effects are inhibited; defining a grammar for creating named, re-usable encapsulations for regular expressions, wherein the encapsulations also allow parameterization and the integration of side-effects; and defining a grammar for a binary composition, called the “subjunctive”, including a primary and secondary term, in which the secondary term is used to narrow the specificity of the primary (by qualifying its matches), while allowing the side-effects of the primary to trigger in the expected way; wherein side-effects are encoded as general statements within the same language or grammar in which the regular expressions are composed; wherein the side-effects are executed by the same machine or virtual machine that executes all of the translated instructions of the language hosting the regular expression; wherein the side-effects are executed as a step of the matching of a regular expression to data, the step occurring just after the “winning” match has been determined, and just before the next statement in code outside of the regular expression is executed; wherein the side-effects do not alter the matching characteristics of a regular expression composition or sub-composition; wherein the side-effects are triggered if and only if the regex composition or sub-composition associated with its side-effects is ultimately matched to data; and wherein the method allows solutions to data matching problems to encode a greater portion of the solution within regular expressions and a lesser portion of the solution within surrounding code.