Sparse Regular Expression Matching

被引:0
|
作者
Bille, Philip [1 ]
Gortz, Inge Li [1 ]
机构
[1] Tech Univ Denmark, Lyngby, Denmark
关键词
ALGORITHM; COMPLEXITY; DERIVATIVES; FOLLOW;
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
A regular expression specifies a set of strings formed by single characters combined with concatenation, union, and Kleene star operators. Given a regular expression R and a string Q, the regular expression matching problem is to decide if Q matches any of the strings specified by R. Regular expressions are a fundamental concept in formal languages and regular expression matching is a basic primitive for searching and processing data. A standard textbook solution [Thompson, CACM 1968] constructs and simulates a nondeterministic finite automaton, leading to an O(nm) time algorithm, where n is the length of Q and m is the length of R. Despite considerable research efforts only polylogarithmic improvements of this bound are known. Recently, conditional lower bounds provided evidence for this lack of progress when Backurs and Indyk [FOCS 2016] proved that, assuming the strong exponential time hypothesis (SETH), regular expression matching cannot be solved in O((nm)(1-epsilon)), for any constant epsilon > 0. Hence, the complexity of regular expression matching is essentially settled in terms of n and m. In this paper, we take a new approach and introduce a density parameter, Delta, that captures the amount of nondeterminism in the NFA simulation on Q. The density is at most nm + 1 but can be significantly smaller. Our main result is a new algorithm that solves regular expression matching in O(Delta log log nm/Delta + n + m) time. This essentially replaces nm with Delta in the complexity of regular expression matching. We complement our upper bound by a matching conditional lower bound that proves that we cannot solve regular expression matching in time O(Delta(1-epsilon)) for any constant epsilon > 0 assuming SETH. The key technical contribution in the result is a new linear space representation of the classic position automaton that supports fast state-set transition computation in near-linear time in the size of the input and output state sets. To achieve this we develop several new insights and techniques of independent interest, including new structural properties of the parse trees of regular expression, a decomposition of state-set transitions based on parse trees, and a fast batched predecessor data structure.
引用
收藏
页码:3354 / 3375
页数:22
相关论文
共 50 条
  • [21] New algorithms for regular expression matching
    Bille, Philip
    AUTOMATA, LANGUAGES AND PROGRAMMING, PT 1, 2006, 4051 : 643 - 654
  • [22] Complexity analysis of extended regular expression matching
    Takahashi, Kazuya
    Minamide, Yasuhiko
    1600, Japan Society for Software Science and Technology (38): : 53 - 70
  • [23] Type Inference for Regular Expression Pattern Matching
    Marin, Mircea
    Craciun, Adrian
    12TH INTERNATIONAL SYMPOSIUM ON SYMBOLIC AND NUMERIC ALGORITHMS FOR SCIENTIFIC COMPUTING (SYNASC 2010), 2011, : 366 - 373
  • [24] Formalising Boost POSIX Regular Expression Matching
    Berglund, Martin
    Bester, Willem
    van der Merwe, Brink
    THEORETICAL ASPECTS OF COMPUTING - ICTAC 2018, 2018, 11187 : 99 - 115
  • [25] TiReX: Tiled Regular eXpression matching architecture
    Comodi, Alessandro
    Conficconi, Davide
    Scolari, Alberto
    Santambrogio, Marco D.
    2018 IEEE INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS (IPDPSW 2018), 2018, : 131 - 137
  • [26] An Improved DFA for Fast Regular Expression Matching
    Ficara, Domenico
    Giordano, Stefano
    Procissi, Gregorio
    Vitucci, Fabio
    Antichi, Gianni
    Di Pietro, Andrea
    ACM SIGCOMM COMPUTER COMMUNICATION REVIEW, 2008, 38 (05) : 31 - 40
  • [27] Streaming Regular Expression Membership and Pattern Matching
    Dudek, Bartlomiej
    Gawrychowski, Pawel
    Gourdel, Garance
    Starikovskaya, Tatiana
    PROCEEDINGS OF THE 2022 ANNUAL ACM-SIAM SYMPOSIUM ON DISCRETE ALGORITHMS, SODA, 2022, : 670 - 694
  • [28] High Throughput Regular Expression Matching Algorithm
    Guo, Huifang
    Jiang, Kunpeng
    2015 INTERNATIONAL CONFERENCE ON COMPUTATIONAL INTELLIGENCE AND COMMUNICATION NETWORKS (CICN), 2015, : 368 - 372
  • [29] Multiple regular expression matching hardware architecture
    Zhang, Wei
    Xue, Yibo
    Song, Tian
    Qinghua Daxue Xuebao/Journal of Tsinghua University, 2009, 49 (10): : 1704 - 1707
  • [30] Compact representations of automata for regular expression matching
    Zhang, Meng
    Zhang, Yi
    Hou, Chen
    INFORMATION PROCESSING LETTERS, 2016, 116 (12) : 750 - 756