a method of optimizing regular expressions including determining an optimized form for regular expressions and presenting the optimized forms for the regular expressions to a user in a source - level representation . a system is provided for authoring regular expressions including a user interface enabling a user to author a regular expression defining a particular text pattern . the user interface enables the user to specify a target data set and a matching algorithm to be used with the regular expression . an optimizer implements transformation rules and processes for applying the transformation rules to an authored regular expression to generate an optimized regular expression presented in a source - level representation . the optimizer may select an alternate preferred pattern matching algorithm and an alternate preferred data source making adjustments to the pattern . an interpreter / compiler operates to receive source - level representations of optimized regular expressions and generate machine executable forms of the optimized regular expressions .