arXiv · 2611.34904
Product-Linear POSIX Parsing
Abstract
POSIX regular-expression matching reports capture spans determined by the parse tree that its disambiguation rules select. Thompson's classical construction decides whether an expression $E$ matches a text $w$ in product-linear time, $O(|E|\,|w|)$. Whether the POSIX parse can also be computed in product-linear time has remained open since the rules were standardized in 1992. For instance, the algorithm of Okui and Suzuki takes $O(|E|^2|w|)$ time after precomputation. We give, to our knowledge, the first algorithm that computes the POSIX parse and all capture spans in product-linear total time, $O(|E|\,|w|)$. It uses $O(|E|+|w|)$ working space and supports full matching, longest-prefix matching, and leftmost-longest search. The algorithm scans the text backward and keeps one preferred continuation per traversal state. It implements POSIX selection with lists of end positions of the open subexpressions, which it compares and updates in constant time.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Yuya Uezato. 2026-11-25. Product-Linear POSIX Parsing. https://arxiv.science/abs/2611.34904
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.