Prefix-Free Regular-Expression Matching

  • Yo-Sub Han
  • Yajun Wang
  • Derick Wood
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3537)


We explore the regular-expression matching problem with respect to prefix-freeness of the pattern. We show that the prefix-free regular expression gives only linear number of matching substrings in the size of a given text. Based on this observation, we propose an efficient algorithm for the prefix-free regular-expression matching problem. Furthermore, we suggest an algorithm to determine whether or not a given regular language is prefix-free.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.: Algorithms for finding patterns in strings. In: van Leeuwen, J. (ed.) Algorithms and Complexity. Handbook of Theoretical Computer Science, vol. A, pp. 255–300. The MIT Press, Cambridge (1990)Google Scholar
  2. 2.
    Aho, A., Corasick, M.: Efficient string matching: An aid to bibliographic search. Communications of the ACM 18, 333–340 (1975)zbMATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Boyer, R.S., Moore, J.S.: A fast string searching algorithm. Communications of the ACM 20(10), 762–772 (1977)CrossRefGoogle Scholar
  4. 4.
    Clarke, C.L.A., Cormack, G.V.: On the use of regular expressions for searching text. ACM Transactions on Programming Languages and Systems 19(3), 413–426 (1997)CrossRefGoogle Scholar
  5. 5.
    Crochemore, M., Hancart, C.: Automata for matching patterns. In: Rozenberg, G., Salomaa, A. (eds.) Linear modeling: background and application. Handbook of Formal Languages, vol. 2, pp. 399–462. Springer, Heidelberg (1997)Google Scholar
  6. 6.
    Giammarresi, D., Montalbano, R.: Deterministic generalized automata. Theoretical Computer Science 215, 191–208 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Han, Y.-S., Wood, D.: The generalization of generalized automata: Expression automata. In: Domaratzki, M., Okhotin, A., Salomaa, K., Yu, S. (eds.) CIAA 2004. LNCS, vol. 3317, pp. 156–166. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  8. 8.
    Hopcroft, J., Ullman, J.: Formal Languages and Their Relationship to Automata. Addison-Wesley, Reading (1969)Google Scholar
  9. 9.
    Knuth, D., Morris Jr., J., Pratt, V.: Fast pattern matching in strings. SIAM Journal on Computing 6, 323–350 (1977)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Myers, E.W., Oliva, P., Guimãraes, K.S.: Reporting exact and approximate regular expression matches. In: Farach-Colton, M. (ed.) CPM 1998. LNCS, vol. 1448, pp. 91–103. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  11. 11.
    Thompson, K.: Regular expression search algorithm. Communications of the ACM 11, 419–422 (1968)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Yo-Sub Han
    • 1
  • Yajun Wang
    • 1
  • Derick Wood
    • 1
  1. 1.Department of Computer ScienceThe Hong Kong University of Science and Technology 

Personalised recommendations