New Algorithms for Regular Expression Matching

  • Philip Bille
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4051)


In this paper we revisit the classical regular expression matching problem, namely, given a regular expression R and a string Q consisting of m and n symbols, respectively, decide if Q matches one of the strings specified by R. We present new algorithms designed for a standard unit-cost RAM with word length w ≥logn. We improve the best known time bounds for algorithms that use O(m) space, and whenever w ≥log2 n, we obtain the fastest known algorithms, regardless of how much space is used.


Word Length Regular Expression Parse Tree Topological Order Outgoing Transition 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: principles, techniques, and tools. Addison-Wesley Longman Publishing Co., Inc., Boston (1986)Google Scholar
  2. 2.
    Baeza-Yates, R., Gonnet, G.H.: A new approach to text searching. Commun. ACM 35(10), 74–82 (1992)CrossRefGoogle Scholar
  3. 3.
    Bille, P., Farach-Colton, M.: Fast and compact regular expression matching, Submitted to a journal (2005), preprint availiable at,
  4. 4.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)MATHGoogle Scholar
  5. 5.
    Hagerup, T., Miltersen, P.B., Pagh, R.: Deterministic dictionaries. J. of Algorithms 41(1), 69–85 (2001)MATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Myers, E.W.: A four-russian algorithm for regular expression pattern matching. J. of the ACM 39(2), 430–448 (1992)MATHCrossRefGoogle Scholar
  7. 7.
    Myers, G.: A fast bit-vector algorithm for approximate string matching based on dynamic programming. J. ACM 46(3), 395–415 (1999)MATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Thompson, K.: Regular expression search algorithm. Comm. of the ACM 11, 419–422 (1968)MATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Philip Bille
    • 1
  1. 1.The IT University of CopenhagenCopenhagen SDenmark

Personalised recommendations