A type system for regular expressions
Submitted by mernst on Tue, 2012-05-15 14:53
| Title | A type system for regular expressions |
| Publication Type | Conference Paper |
| Year of Publication | 2012 |
| Authors | Spishak E, Dietl W, Ernst MD |
| Conference Name | FTfJP'2012: 14th Workshop on Formal Techniques for Java-like Programs |
| Date or Month Published | June 12 |
| Conference Location | Beijing, China |
| Abstract | <p>Regular expressions are used to match and extract text. It is easy for developers to make syntactic mistakes when writing regular expressions, because regular expressions are often complex and different across programming languages. Such errors result in exceptions at run time, and there is currently no static support for preventing them. </p> <p> This paper describes practical experience designing and using a type system for regular expressions. This type system validates regular expression syntax and capturing group usage at compile time instead of at run time –- ensuring the absence of <tt>PatternSyntaxException</tt>s from invalid syntax and <tt>IndexOutOfBoundsException</tt>s from accessing invalid capturing groups. </p> <p> Our implementation is publicly available and supports the full Java language. In an evaluation on five open-source Java applications (480kLOC), the type system was easy to use, required less than one annotation per two thousand lines, and found 56 previously-unknown bugs.</p> |
| Downloads | Regex Checker implementation |
| Citation Key | SpishakDE2012 |
Last changed Mon, 2013-06-03 10:27

cs.