RUS  ENG
Full version
JOURNALS // Modelirovanie i Analiz Informatsionnykh Sistem // Archive

Model. Anal. Inform. Sist., 2024 Volume 31, Number 4, Pages 426–445 (Mi mais834)

Theory of computing

Disambiguation of regular expressions with backreferences via term rewriting

D. N. Ismagilovaa, A. N. Nepeivodab

a Bauman Moscow State Technical University, Moscow, Russia
b Program Systems Institute of RAS, Veskovo, Yaroslavl region, Russia

Abstract: In this paper we focus on regular expressions with acyclic backreferences and treat them as a semiring satisfying certain theorems of Kleene algebra. Using these theorems as term rewriting rules, we introduce an algorithm for memory disambiguation of regular expressions. Furthermore, we demonstrate that the class of regexes with acyclic backreferences is closed under language reversal, in contrast to the generic backref-regexes, and provide the reversal algorithm, based on the disambiguation procedure. The results of our experiments revealed that, in certain cases, the matching time was significantly reduced when using the reversed expressions compared to the initial ones.

Keywords: extended regular expression, backreferences, Kleene algebra, capture group, reversal, disambiguation.

UDC: 004.415.52

MSC: 68Q45

Received: 06.11.2024
Revised: 15.11.2024
Accepted: 30.11.2024

Language: English

DOI: 10.18255/1818-1015-2024-4-426-445



© Steklov Math. Inst. of RAS, 2025