Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:1907.04752

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Data Structures and Algorithms

arXiv:1907.04752 (cs)
[Submitted on 10 Jul 2019 (v1), last revised 6 Nov 2023 (this version, v7)]

Title:Sparse Regular Expression Matching

Authors:Philip Bille, Inge Li Gørtz
View a PDF of the paper titled Sparse Regular Expression Matching, by Philip Bille and Inge Li G{\o}rtz
View PDF
Abstract:A regular expression specifies a set of strings formed by single characters combined with concatenation, union, and Kleene star operators. Given a regular expression $R$ and a string $Q$, the regular expression matching problem is to decide if $Q$ matches any of the strings specified by $R$. Regular expressions are a fundamental concept in formal languages and regular expression matching is a basic primitive for searching and processing data. A standard textbook solution [Thompson, CACM 1968] constructs and simulates a nondeterministic finite automaton, leading to an $O(nm)$ time algorithm, where $n$ is the length of $Q$ and $m$ is the length of $R$. Despite considerable research efforts only polylogarithmic improvements of this bound are known. Recently, conditional lower bounds provided evidence for this lack of progress when Backurs and Indyk [FOCS 2016] proved that, assuming the strong exponential time hypothesis (SETH), regular expression matching cannot be solved in $O((nm)^{1-\epsilon})$, for any constant $\epsilon > 0$. Hence, the complexity of regular expression matching is essentially settled in terms of $n$ and $m$.
In this paper, we take a new approach and introduce a \emph{density} parameter, $\Delta$, that captures the amount of nondeterminism in the NFA simulation on $Q$. The density is at most $nm+1$ but can be significantly smaller. Our main result is a new algorithm that solves regular expression matching in $$O\left(\Delta \log \log \frac{nm}{\Delta} +n + m\right)$$ time. This essentially replaces $nm$ with $\Delta$ in the complexity of regular expression matching. We complement our upper bound by a matching conditional lower bound that proves that we cannot solve regular expression matching in time $O(\Delta^{1-\epsilon})$ for any constant $\epsilon > 0$ assuming SETH.
Subjects: Data Structures and Algorithms (cs.DS)
Cite as: arXiv:1907.04752 [cs.DS]
  (or arXiv:1907.04752v7 [cs.DS] for this version)
  https://doi.org/10.48550/arXiv.1907.04752
arXiv-issued DOI via DataCite

Submission history

From: Philip Bille [view email]
[v1] Wed, 10 Jul 2019 14:29:22 UTC (2,496 KB)
[v2] Tue, 22 Feb 2022 08:05:05 UTC (3,741 KB)
[v3] Tue, 7 Jun 2022 06:54:28 UTC (3,743 KB)
[v4] Thu, 10 Nov 2022 07:41:48 UTC (3,745 KB)
[v5] Fri, 10 Feb 2023 08:40:19 UTC (3,745 KB)
[v6] Fri, 14 Jul 2023 10:40:04 UTC (3,218 KB)
[v7] Mon, 6 Nov 2023 13:12:47 UTC (3,329 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Sparse Regular Expression Matching, by Philip Bille and Inge Li G{\o}rtz
  • View PDF
  • TeX Source
  • Other Formats
view license
Current browse context:
cs.DS
< prev   |   next >
new | recent | 2019-07
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Philip Bille
Inge Li Gørtz
export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack