Efficient Matching with Memoization for Regexes with Look-around and Atomic Grouping

被引:1
|
作者
Fujinami, Hiroya [1 ,2 ]
Hasuo, Ichiro [1 ,2 ]
机构
[1] Natl Inst Informat, Tokyo, Japan
[2] SOKENDAI Grad Univ Adv Studies, Hayama, Kanagawa, Japan
关键词
regular expression; look-around; atomic grouping; pattern matching; ReDoS; memoization;
D O I
10.1007/978-3-031-57267-8_4
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Regular expression (regex) matching is fundamental in many applications, especially in web services. However, matching by backtracking-preferred by most real-world implementations for its practical performance and backward compatibility-can suffer from so-called catastrophic backtracking, which makes the number of backtracking super-linear and leads to the well-known ReDoS vulnerability. Inspired by a recent algorithm by Davis et al. that runs in linear time for (non-extended) regexes, we study efficient backtracking matching for regexes with two common extensions, namely look-around and atomic grouping. We present linear-time backtracking matching algorithms for these extended regexes. Their efficiency relies on memoization, much like the one by Davis et al.; we also strive for smaller memoization tables by carefully trimming their range. Our experiments-we used some real-world regexes with the aforementioned extensions-confirm the performance advantage of our algorithms.
引用
收藏
页码:90 / 118
页数:29
相关论文
共 17 条
  • [1] Memory-efficient flow accumulation using a look-around approach and its OpenMP parallelization
    Cho, Huidae
    ENVIRONMENTAL MODELLING & SOFTWARE, 2023, 167
  • [2] A "Look-around Lanczos" algorithm for solving a system of linear equations
    Graves-Morris, PR
    NUMERICAL ALGORITHMS, 1997, 15 (3-4) : 247 - 274
  • [3] A “Look-around Lanczos” algorithm for solving a system of linear equations
    P.R. Graves-Morris
    Numerical Algorithms, 1997, 15 : 247 - 274
  • [4] Emergence of exploratory look-around behaviors through active observation completion
    Ramakrishnan, Santhosh K.
    Jayaraman, Dinesh
    Grauman, Kristen
    SCIENCE ROBOTICS, 2019, 4 (30)
  • [5] THE VAGARIES AND MYTHS OF LOOK-AROUND DEEP-RESISTIVITY MEASUREMENTS WHILE DRILLING
    Rabinovich, Michael
    Le, Fei
    Lofts, Jeremy
    Martakov, Sergey
    PETROPHYSICS, 2012, 53 (02): : 86 - 101
  • [6] Net-pay optimization and improved mapping with look-around LWD measurements
    Antonsen, Frank
    Olsen, Per Atle
    Stalheim, Stein Ottar
    Constable, Monica Vik
    Irondelle, Matthieu
    Cook, Michael
    Bjørstad, Trond Rognebakke
    Dupuis, Christophe
    Marza, Philippe
    Seydoux, Jean
    Omeragic, Dzevat
    Denichou, Jean-Michel
    JPT, Journal of Petroleum Technology, 2015, 67 (08): : 80 - 82
  • [7] Virtual environment navigation with look-around mode to explore new real spaces by people who are blind
    Lahav, Orly
    Gedalevitz, Hadas
    Battersby, Steven
    Brown, David
    Evett, Lindsay
    Merritt, Patrick
    DISABILITY AND REHABILITATION, 2018, 40 (09) : 1072 - 1084
  • [8] Exploring efficient grouping algorithms in regular expression matching
    Xu, Chengcheng
    Su, Jinshu
    Chen, Shuhui
    PLOS ONE, 2018, 13 (10):
  • [9] Efficient compression of hyperspectral images by grouping around lines
    Gladkova, I.
    Nalli, N.
    Wolf, W.
    Zhou, L.
    Goldberg, M.
    Roytman, L.
    INFORMATION OPTICS, 2006, 860 : 321 - +
  • [10] Electric and magnetic dipole antennas of a directional resistivity logging-while-drilling tool for "look-around" boundary detection
    Fan, Jianbao
    Zhang, Wenxiu
    Chen, Wenxuan
    Li, Xinghan
    Liang, Pengfei
    GEOPHYSICS, 2021, 86 (06) : D215 - D239