On the computational complexity of JavaScript regex matching

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Deng, Victor, Barrière, Aurèle, Pit-Claudel, Clément
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918412727353344
author Deng, Victor
Barrière, Aurèle
Pit-Claudel, Clément
author_facet Deng, Victor
Barrière, Aurèle
Pit-Claudel, Clément
contents Despite widespread use, the complexity class of modern regular expression matching was not well-understood. Previous work proved that regular expression matching with backreferences and lookarounds was PSPACE-complete, but the proof was not mechanized and applied to an abstract regex language. This paper clarifies the question for JavaScript regular expressions. In this paper, we prove the following new results, with most core proofs mechanized in the Rocq proof assistant. We prove that JavaScript regex matching is indeed PSPACE-hard, even without negative lookarounds, and OptP-hard as well; that JavaScript regex matching without lower-bounded quantifiers (i.e. quantifiers with a non-zero minimum number of repetitions) is PSPACE-complete; and that JavaScript regex matching without lower-bounded quantifiers and without lookarounds is OptP-complete.
format Preprint
id arxiv_https___arxiv_org_abs_2603_26139
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle On the computational complexity of JavaScript regex matching
Deng, Victor
Barrière, Aurèle
Pit-Claudel, Clément
Programming Languages
Despite widespread use, the complexity class of modern regular expression matching was not well-understood. Previous work proved that regular expression matching with backreferences and lookarounds was PSPACE-complete, but the proof was not mechanized and applied to an abstract regex language. This paper clarifies the question for JavaScript regular expressions. In this paper, we prove the following new results, with most core proofs mechanized in the Rocq proof assistant. We prove that JavaScript regex matching is indeed PSPACE-hard, even without negative lookarounds, and OptP-hard as well; that JavaScript regex matching without lower-bounded quantifiers (i.e. quantifiers with a non-zero minimum number of repetitions) is PSPACE-complete; and that JavaScript regex matching without lower-bounded quantifiers and without lookarounds is OptP-complete.
title On the computational complexity of JavaScript regex matching
topic Programming Languages
url https://arxiv.org/abs/2603.26139