Affiliation:
1. Brno University of Technology, Czechia
2. Microsoft, USA
Abstract
We propose a solution to the problem of efficient matching regular expressions (regexes) with bounded repetition, such as (ab){1,100}, using deterministic automata. For this, we introduce novel
counting-set automata (CsAs)
, automata with registers that can hold sets of bounded integers and can be manipulated by a limited portfolio of constant-time operations. We present an algorithm that compiles a large sub-class of regexes to deterministic CsAs. This includes (1) a novel Antimirov-style translation of regexes with counting to
counting automata (CAs)
, nondeterministic automata with bounded counters, and (2) our main technical contribution, a determinization of CAs that outputs CsAs. The main advantage of this workflow is that
the size of the produced CsAs does not depend on the repetition bounds used in the regex
(while the size of the DFA is exponential to them). Our experimental results confirm that deterministic CsAs produced from practical 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 sizes of counter bounds. It easily copes with regexes with repetition where state-of-the-art matchers struggle.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference47 articles.
1. R-Automata
2. A Unified Construction of the Glushkov, Follow, and Antimirov Automata
3. Valentin Antimirov. 1996. Partial derivatives of regular expressions and nite automaton constructions. Theoretical Computer Science 155 2 ( 1996 ) 291-319. https://doi.org/10.1016/ 0304-3975 ( 95 ) 00182-4 10.1016/0304-3975(95)00182-4 Valentin Antimirov. 1996. Partial derivatives of regular expressions and nite automaton constructions. Theoretical Computer Science 155 2 ( 1996 ) 291-319. https://doi.org/10.1016/ 0304-3975 ( 95 ) 00182-4 10.1016/0304-3975(95)00182-4
4. Adam Baldwin. 2016. Regular Expression Denial of Service a ecting Express.js. http://web.archive.org/web/20170116160113/ https://medium.com/node-security/ regular-expression-denial-of-service-a ecting-express-js-9c397c164c43 Adam Baldwin. 2016. Regular Expression Denial of Service a ecting Express.js. http://web.archive.org/web/20170116160113/ https://medium.com/node-security/ regular-expression-denial-of-service-a ecting-express-js-9c397c164c43
5. Sébastien Bardin Alain Finkel Jérôme Leroux and Laure Petrucci. 2008. FAST: acceleration from theory to practice. STTT 10 5 ( 2008 ) 401-424. https://doi.org/10.1007/s10009-008-0064-3 10.1007/s10009-008-0064-3 Sébastien Bardin Alain Finkel Jérôme Leroux and Laure Petrucci. 2008. FAST: acceleration from theory to practice. STTT 10 5 ( 2008 ) 401-424. https://doi.org/10.1007/s10009-008-0064-3 10.1007/s10009-008-0064-3
Cited by
8 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献