Unique Pattern Matching in Strings
Stijn Vansummeren
Abstract
Regular expression patterns are a key feature of document processing languages like Perl and XDuce. It is in this context that the first and longest match policies have been proposed to disambiguate the pattern matching process. We formally define a matching semantics with these policies and show that the generally accepted method of simulating longest match by first match and recursion is incorrect. We continue by solving the associated type inference problem, which consists in calculating for every subexpression the set of words the subexpression can still match when these policies are in effect, and show how this algorithm can be used to efficiently implement the matching process.
Create a lesson
Related papers
How Often Does Your Program Fail?
Arnab Ray, Aalok Thakkar
Metamorphic Testing for Floating-Point Performance Issues in SMT Solvers
Rosa Abbasi, Eva Darulova
The Output-Space Hypothesis: Enumerative Equivalence Checking for Tensor Programs
Paul Biberstein, Joseph Devietti, Mayur Naik
Theories of Mind as Domain-Specific Languages of Thought
Kartik Chandra, Jonathan Ragan-Kelley, Joshua B. Tenenbaum et al.
LLVM Translation Validation Automated with Large Language Models and Lean
Chunhao Liao, Hongxu Xu, Xintong Zhou et al.
Splyce: SIMD Vectorization of Sparse Coiteration
Kabilan Mahathevan, Poorna Gunathilaka, Kirshanthan Sundararajah