Search arXivSearch

arXiv · 2601.03020

Hardness of Regular Expression Matching with Extensions

Abstract

Regular expression matching asks whether a given regular expression of length $m$ matches a given string of length $n$, and its time complexity is fairly well understood. Meanwhile, regular expressions have been extended to support various extensions for both theoretical and practical reasons, which can substantially change the time complexity of the matching problem. In this work, we consider four well-known extensions to regular expressions called intersection, squaring, complement and backreference, and we prove a number of novel conditional time complexity lower bounds for the regular expression matching problems with these extensions under the Orthogonal Vectors Conjecture, the $k$-Orthogonal Vectors Conjecture or the $k$-Clique hypotheses. Our lower bounds significantly narrow the gaps to the known upper bounds, with some even being (conditionally) optimal in that the dependence on $n$ cannot be polynomially reduced while keeping the dependence on $m$ polynomial (or even elementary, for complement). Additionally, to obtain our results for intersection, squaring and complement in a unified manner, we introduce novel problems called Dyck Selection, Orthogonal Dyck Selection and Generalized Dyck Selection. They are arguably natural formal language and stringology problems that are based on Greibach's hardest context-free language and capture the essence of why the regular expression matching problems with these extensions are hard.

Explore related subjects

Keep this discovery

BibTeXRIS

Taisei Nogami, Yoshiki Nakamura, Tachio Terauchi. 2026-09-06. Hardness of Regular Expression Matching with Extensions. https://arxiv.org/abs/2601.03020

Cite the original work for its findings. Save a collection to share your selection of sources.

Discover connections

Connections use source metadata and explicit phrase matches, not verified experimental comparisons.

KEEP EXPLORING

Related papers

Completely Reachable Road Coloring

We characterize the digraphs that admit an edge labeling by letters from a finite alphabet such that the resulting labeled digraph is a completely reachable automaton. This class of digraphs can be recognized in polynomial time. In contrast, we show that, for every fixed alphabet size, the problem of deciding whether a digraph admits an edge labeling with the same property is NP-complete. We also classify the digraphs for which every edge labeling results in a completely reachable automaton.

cs.FL

An Elementary Proof of the $\widetilde O(n^{1/3})$ Bound for Separating Words

For two distinct binary words of length $n$, the separating words problem asks for a small deterministic finite automaton that accepts exactly one of them. Chase proved a $\widetilde O(n^{1/3})$ upper bound using a complex-analytic estimate for sparse polynomials. We replace that estimate by a finite-difference argument and a second-order real recurrence cutoff. The resulting elementary proof gives an explicit bound of $O(n^{1/3}(\log n)^{7/3})$ states.

cs.FL

The Complexity of Coverability-Like Problems in Elementary Object Systems: Data-Nets to the Rescue

Elementary Object Systems (EOSs) are a model in the nets-within-nets (NWNs) paradigm, where tokens in turn can host standard Petri nets. We study the complexity of coverability-like problems, including termination and boundedness, over EOSs. Since coverability and boundedness are undecidable in general on EOSs, we focus on the relevant fragment of conservative EOSs (cEOSs). Our technique interprets cEOSs into the framework of data nets, whose tokens carry data from an infinite domain, thus bridging the nesting and the data-aware paradigms. Specifically, we show that cEOS coverability-like problems are equivalent to the coverability-like problems over an interesting fragment, called channel-$ν$PNs (c-$ν$PNs), of data nets that extends $ν$PN (featuring globally fresh name creation) with restricted forms of transfers with renaming. c-$ν$PNs remain less expressive than Unordered Data Nets, which feature lossy name creation as well as powerful forms of whole-place operations and broadcasts. These reductions allow us to analyze cEOS coverability taking advantage of known results on data nets. We conclude that the complexity of cEOS coverability is double-Ackermanian, $\mathcal{F}_{ω2}$-complete, while termination and boundedness are non-primitive recursive.

cs.CC