Skip to main content

Fast Algorithms for Extended Regular Expression Matching and Searching

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2607))

Abstract

Extended regular expressions are an extension of ordinary regular expressions by the operations of intersection and complement. We give new algorithms for extended regular expression matching and searching which improve significantly the (very old) best upper bound for this problem, due to Hopcroft and Ullman. For an extended regular expression of size m with p intersection and complement operators and an input word of length n our algorithms run in time O(mn2) and space O(pn2) while the one of Hopcroft and Ullman runs in time O(mn3) and space O(mn2). Since the matching problem for semiextended regular expressions (only intersection is added) has been very recently shown to be LOGCFL complete, our algorithms are very likely the best one can expect. We also emphasize the importance of the extended regular expressions for software programs currently using ordinary regular expressions and show how the algorithms presented can be improved to run significantly faster in practical applications.

Research partially supported by NSERC grant R3143A01.

corresponding author

Research partially supported by NSERC grant OGP0041630.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A., Algorithms for finding patterns in strings, in: J. van Leeuwen (ed.), Handbook of Theoretical Computer Science, Elsevier, 1990, 256–300.

    Google Scholar 

  2. Aho, A., Hopcroft, J., and Ullman, J., The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, MA, 1974.

    MATH  Google Scholar 

  3. Aho, A., Sethi, R., Ullman, J., Compilers: Principles, Techniques, and Tools, Addison-Wesley, MA, 1988.

    Google Scholar 

  4. Crochemore, M., Hancart, C., Automata for pattern matching, in: G. Rozenberg, A. Salomaa, eds., Handbook of Formal Languages, Vol. II, Springer-Verlag, Berlin, 1997, 399–462.

    Google Scholar 

  5. Friedl, J., Mastering Regular Expressions, O’Reilly, 1998.

    Google Scholar 

  6. Hirst, S. C., A new algorithm for solving membership of extended regular expressions, Rep. 354, Basser Department of Computer Science, Univ. of Sydney, 1989.

    Google Scholar 

  7. Hopcroft, J., and Ullman, J., Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, MA, 1979.

    MATH  Google Scholar 

  8. Hunt, H. B.,III, The equivalence problem for regular expressions with intersection is not polynomial in tape, TR 73-156, Dept. of Computer Science, Cornell Univ., Ithaca, N.Y., 1973.

    Google Scholar 

  9. Knight, J., and Myers, E., Super-Pattern Matching, Algorithmica 13 (1995), no. 1–2, 211–243.

    Article  MATH  MathSciNet  Google Scholar 

  10. Knuth, D., The Art of Computer Programming, vol. I, 3rd edition, Addison-Wesley, Reading, MA, 1997.

    Google Scholar 

  11. Meyer, R. E, and Stockmeyer, L., Nonelementary word problems in automata and logic, in: Proc. AMS Symposium on Complexity of Computation, 1973.

    Google Scholar 

  12. Meyer, R. E, and Stockmeyer, L., Word problems requiring exponential time: preliminary report, in: Proc. of 5th STOC (1973), Assoc. Comput. Mach., New York, 1973, 1–9.

    Google Scholar 

  13. Petersen, H., The membership problem for regular expressions with intersection is complete in LOGCFL, in: H. Alt, A. Ferreira, eds., Proc. of STACS 2002, Lecture Notes in Comput. Sci. 2285, Springer-Verlag, Berlin, 2002, 513–522.

    Google Scholar 

  14. Thompson, K., Regular expression search algorithm, Comm. ACM 11 (6) (1968) 419–422.

    Article  MATH  Google Scholar 

  15. Yamamoto, H., An automata-based recognition algorithm for semi-extended regular expressions, in: M. Nielsen, B. Rovan, eds., Proc of MFCS 2000, 699–708, Lecture Notes in Comput. Sci., 1893, Springer-Verlag, Berlin, 2000, 699–708.

    Google Scholar 

  16. Yamamoto, H., A New Recognition Algorithm for Extended Regular Expressions, in: P. Eades and T. Takaoka, eds., Proc of ISAAC 2001, Lecture Notes in Comput. Sci. 2223, Springer-Verlag Berlin, 2001, 257–267.

    Google Scholar 

  17. Yu, S., Regular Languages, in: G. Rozenberg, A. Salomaa, Handbook of Formal Languages, Vol. I, Springer-Verlag, Berlin, 1997, 41–110.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ilie, L., Shan, B., Yu, S. (2003). Fast Algorithms for Extended Regular Expression Matching and Searching. In: Alt, H., Habib, M. (eds) STACS 2003. STACS 2003. Lecture Notes in Computer Science, vol 2607. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36494-3_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-36494-3_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-00623-7

  • Online ISBN: 978-3-540-36494-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics