A system that can produce regular expressions from user-provided examples performed with high precision and recall in 12 text-extraction tasks from real-world datasets, demonstrating the effectiveness of text extraction based on genetic programming. R egular expressions have long been used to concisely specify string patterns, which a specialized engine then uses to extract strings that match the patterns from a data stream. Regular expressions are expressive and flexible, making them a popular tool in a range of text-processing applications across vastly different domains, from XML schema construction to phishing detection. Constructing a regular expression for a specific task is tedious and error-prone, requiring special skills and familiarity with the formalisms involved in generating regular expressions. Consequently, much work has focused on generating regular expressions automatically. The sidebar "Automatic Regular Expression Generation" describes related work, which has varying degrees of practical application. For example, some proposed systems require the user to provide the initial regular expression or hints about the target expression's structure or symbols-both of which require familiarity with the syntax of regular expressions. To explore a more practical approach, we designed a prototype system (http://regex.inginf.units.it) that greatly simplifies the user's role in employing regular expressions for text extraction. In our system, the user describes the extraction task by providing a set of examples in the form of strings. Each string is accompanied by the (possibly empty) substring to be extracted. On the basis of these examples, the system generates a regular expression suitable for use with popular engines such as Java, PHP, and Perl. Using a computational paradigm inspired by biological evolutionmultiobjective genetic programming (GP) 1 -the system automatically generates a regular expression that is based on the examples. By automating regular expression generation in this way, we have provided a system in which users need no familiarity with either GP or regular expressions syntax. We extensively evaluated our system's performance in an experiment involving 12 extraction tasks, only one of which was based on a synthetically generated dataset. Our precision and recall results averaged 90 percent, which is superior to the baseline results with earlier systems. Moreover, the system achieved these results with just tens of examples and generated a regular expression in minutes instead of hours. Because of these results, our system could be a practical surrogate for the specific skills needed to generate regular expressions, at least for extraction problems similar to those in our evaluation.
On the other hand, the automatic generation of regular expressions from examples is a current research topic REF .
Automatic Synthesis of Regular Expressions from Examples
Computer
Computer
Computer Science