New Algorithms for Regular Expression Matching

Abstract

In this paper we revisit the classical regular expression matching problem, namely, given a regular expression R and a string Q, decide if Q matches one of the strings specified by R. Let m and n be the length of R and Q, respectively. On a standard unit-cost RAM with word length w ≥ n, we show that the problem can be solved in O(m) space with the following running times: equation* cases O(nm ww + m w) & if m > w \\ O(n m + m m) & if w < m ≤ w \\ O((n+ m2, n m + m m)) & if m ≤ w. cases equation* This improves the best known time bound among algorithms using O(m) space. Whenever w ≥ 2 n it improves all known time bounds regardless of how much space is used.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…