Werner Dietl
wdietl@uwaterloo.ca, Room EIT 4007
A type system for regular expressions
Download: PDF.
“A type system for regular expressions” by E. Spishak, W. Dietl, and M. D. Ernst. In Formal Techniques for Java-like Programs (FTfJP), June 2012, pp. 20-26.
Abstract
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.
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 PatternSyntaxExceptions from invalid syntax and IndexOutOfBoundsExceptions from accessing invalid capturing groups.
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.
Download: PDF.
BibTeX entry:
@inproceedings{SpishakDietlErnst12, author = {E. Spishak and W. Dietl and M. D. Ernst}, title = {A type system for regular expressions}, month = jun, }
Copyright notice: This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author’s copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder.
(This webpage was created with bibtex2web.)