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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Aho, A., Algorithms for finding patterns in strings, in: J. van Leeuwen (ed.), Handbook of Theoretical Computer Science, Elsevier, 1990, 256–300.
Aho, A., Hopcroft, J., and Ullman, J., The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, MA, 1974.
Aho, A., Sethi, R., Ullman, J., Compilers: Principles, Techniques, and Tools, Addison-Wesley, MA, 1988.
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.
Friedl, J., Mastering Regular Expressions, O’Reilly, 1998.
Hirst, S. C., A new algorithm for solving membership of extended regular expressions, Rep. 354, Basser Department of Computer Science, Univ. of Sydney, 1989.
Hopcroft, J., and Ullman, J., Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, MA, 1979.
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.
Knight, J., and Myers, E., Super-Pattern Matching, Algorithmica 13 (1995), no. 1–2, 211–243.
Knuth, D., The Art of Computer Programming, vol. I, 3rd edition, Addison-Wesley, Reading, MA, 1997.
Meyer, R. E, and Stockmeyer, L., Nonelementary word problems in automata and logic, in: Proc. AMS Symposium on Complexity of Computation, 1973.
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.
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.
Thompson, K., Regular expression search algorithm, Comm. ACM 11 (6) (1968) 419–422.
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.
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.
Yu, S., Regular Languages, in: G. Rozenberg, A. Salomaa, Handbook of Formal Languages, Vol. I, Springer-Verlag, Berlin, 1997, 41–110.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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