Publication result detail

Regex Matching with Counting-Set Automata

HOLÍKOVÁ, L.; HOLÍK, L.; LENGÁL, O.; SAARIKIVI, O.; VEANES, M.; VOJNAR, T.

Original Title

Regex Matching with Counting-Set Automata

English Title

Regex Matching with Counting-Set Automata

Type

WoS Article

Original Abstract

We propose a solution to the problem of efficient matching regular expressions (regexes) with boundedrepetition, such as (ab){1,100}, using deterministic automata. For this, we introduce novel counting-setautomata (CsAs), automata with registers that can hold sets of bounded integers and can be manipulated bya limited portfolio of constant-time operations. We present an algorithm that compiles a large sub-class ofregexes to deterministic CsAs. This includes (1) a novel Antimirov-style translation of regexes with countingto counting automata (CAs), nondeterministic automata with bounded counters, and (2) our main technicalcontribution, a determinization of CAs that outputs CsAs. The main advantage of this workflow is that thesize of the produced CsAs does not depend on the repetition bounds used in the regex (while the size ofthe DFA is exponential to them). Our experimental results confirm that deterministic CsAs produced frompractical regexes with repetition are indeed vastly smaller than the corresponding DFAs. More importantly,our prototype matcher based on CsA simulation handles practical regexes with repetition regardless of sizesof counter bounds. It easily copes with regexes with repetition where state-of-the-art matchers struggle.

English abstract

We propose a solution to the problem of efficient matching regular expressions (regexes) with boundedrepetition, such as (ab){1,100}, using deterministic automata. For this, we introduce novel counting-setautomata (CsAs), automata with registers that can hold sets of bounded integers and can be manipulated bya limited portfolio of constant-time operations. We present an algorithm that compiles a large sub-class ofregexes to deterministic CsAs. This includes (1) a novel Antimirov-style translation of regexes with countingto counting automata (CAs), nondeterministic automata with bounded counters, and (2) our main technicalcontribution, a determinization of CAs that outputs CsAs. The main advantage of this workflow is that thesize of the produced CsAs does not depend on the repetition bounds used in the regex (while the size ofthe DFA is exponential to them). Our experimental results confirm that deterministic CsAs produced frompractical regexes with repetition are indeed vastly smaller than the corresponding DFAs. More importantly,our prototype matcher based on CsA simulation handles practical regexes with repetition regardless of sizesof counter bounds. It easily copes with regexes with repetition where state-of-the-art matchers struggle.

Keywords

regular expression matching, bounded repetition, ReDos, determinization,Antimirovs derivatives, counting automata, counting-set automata

Key words in English

regular expression matching, bounded repetition, ReDos, determinization,Antimirovs derivatives, counting automata, counting-set automata

Authors

HOLÍKOVÁ, L.; HOLÍK, L.; LENGÁL, O.; SAARIKIVI, O.; VEANES, M.; VOJNAR, T.

RIV year

2021

Released

01.10.2020

ISBN

2475-1421

Periodical

Proceedings of the ACM on Programming Languages-PACMPL

Volume

4

Number

11

State

United States of America

Pages from

1

Pages to

30

Pages count

30

URL

BibTex

@article{BUT168498,
  author="HOLÍKOVÁ, L. and HOLÍK, L. and LENGÁL, O. and SAARIKIVI, O. and VEANES, M. and VOJNAR, T.",
  title="Regex Matching with Counting-Set Automata",
  journal="Proceedings of the ACM on Programming Languages-PACMPL",
  year="2020",
  volume="4",
  number="11",
  pages="1--30",
  doi="10.1145/3428286",
  url="https://www.microsoft.com/en-us/research/uploads/prod/2020/09/MSR-TR-2020-31.pdf"
}