Typed and unambiguous pattern matching on strings using regular expressions

Claus Brabrand, Jakob G. Thomsen

Research output: Conference Article in Proceeding or Book/Report chapterArticle in proceedingsResearchpeer-review

Abstract

We show how to achieve typed and unambiguous declarative
pattern matching on strings using regular expressions
extended with a simple recording operator.

We give a characterization of ambiguity of regular expressions
that leads to a sound and complete static analysis. The
analysis is capable of pinpointing all ambiguities in terms of
the structure of the regular expression and report shortest
ambiguous strings. We also show how pattern matching can
be integrated into statically typed programming languages
for deconstructing strings and reproducing typed and structured
values.

We validate our approach by giving a full implementation
of the approach presented in this paper. The resulting tool,
reg-exp-rec, adds typed and unambiguous pattern matching
to Java in a stand-alone and non-intrusive manner. We
evaluate the approach using several realistic examples.
Original languageEnglish
Title of host publicationProceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
Number of pages12
PublisherAssociation for Computing Machinery
Publication date2010
Pages243-254
ISBN (Print)978-1-4503-0132-9
Publication statusPublished - 2010
EventInternational Conference on Principles and Practice of Declarative Programming (PPDP 2010) - Hagenberg, Austria
Duration: 26 Jul 201028 Jul 2010
Conference number: 12th
http://www.risc.jku.at/conferences/ppdp2010/

Conference

ConferenceInternational Conference on Principles and Practice of Declarative Programming (PPDP 2010)
Number12th
Country/TerritoryAustria
CityHagenberg
Period26/07/201028/07/2010
Internet address

Fingerprint

Dive into the research topics of 'Typed and unambiguous pattern matching on strings using regular expressions'. Together they form a unique fingerprint.

Cite this