Hardness of Regular Expression Matching with Extensions
Abstract
The regular expression matching problem asks whether a given regular expression of length matches a given string of length . As is well known, the problem can be solved in time using Thompson's algorithm. Moreover, recent studies have shown that regular expression matching extended with a practical extension called lookaround can be solved in the same time complexity. In this work, we consider four well-known extensions to regular expressions called backreference, squaring, intersection and complement. We prove a number of novel time complexity lower bounds for regular expression matching with these extensions under the Orthogonal Vectors Conjecture (OVC), -OVC, -Clique Hypothesis, and Combinatorial -Clique Hypothesis. Some highlights of our results include the fact that none of the matching problems with the extensions can be solved in time for any constant (for backreference, even when restricted to one capturing group) under OVC, and that the problem with complement, also known as extended regular expression (ERE) matching, cannot be solved in time under OVC, under the -Clique Hypothesis (where is the matrix multiplication exponent), and under the Combinatorial -Clique Hypothesis, respectively. In particular, the latter two results show that the -time ERE matching algorithm introduced by Hopcroft and Ullman in 1979 and recently improved by Bille, G{\o}rtz and Jessen to run in time using fast matrix multiplication was already optimal in a sense, and shed light on why the theoretical computer science community has struggled to improve the time complexity of ERE matching with respect to and for more than 45 years.
Keywords
Cite
@article{arxiv.2601.03020,
title = {Hardness of Regular Expression Matching with Extensions},
author = {Taisei Nogami and Yoshiki Nakamura and Tachio Terauchi},
journal= {arXiv preprint arXiv:2601.03020},
year = {2026}
}