Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

A Four Russians algorithm for regular expression pattern matching

Published: 01 April 1992 Publication History

Abstract

Given a regular expression R of length P and a word A of length N, the membership problem is to determine if A is in the language denoted by R. An O(PN/lgN) time algorithm is presented that is based on a lgN speedup of the standard O(PN) time simulation of R's nonderministic finite automaton on A using a combination of the node-listing and “Four-Russians” paradigms. This result places a new worst-case upper bound on regular expression pattern matching. Moreover, in practice the method provides an implementation that is faster than existing software for small regular expressions.

References

[1]
Ano, A. V. Pattern matching in strings. In R. Book, ed. In Formal Language Theory. Academic Press, Orlando, Fla., 1980.
[2]
Ano, A. V., HOPCROVT, J. E., AND ULLMAN, J. D. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, Mass., 1975.
[3]
AHO, A. g., SETHI, R., AND ULLMAN, J. D. Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading, PA., 1985.
[4]
ARLAZAROV, V. L., DINIC, E. A., KRONROD, M. A., AND FARADZEV, I. A. On economic construction of the transitive closure of a directed graph. Dokl. Acad. Nauk SSSR 194 (1970), 487-488 (in Russian). English translation in Soz'iet Math. Dokl. 11 (1975), 1209-1210.
[5]
GALIL, Z. Open problems in stringology. A. Apostolico and Z. Galil, eds. In Combinatorzal Algorithms on Words. Springer-Verlag, New York, 1985, pp. 1-8.
[6]
HECHT, M. S., AND ULLMAN, J. D. A simple algorithm for global flow analysis programs. SIAM J. Comput. 4, 4 (1975), 519-532.
[7]
KENNEDY, K. Node listings applied to data flow analysis. In Conference Record of the 2rid A CM Symposium on Principles of Programming Languages (Palo Alto, Calif. Jan. 20-22). ACM, New York, 1975, pp. 10-21.
[8]
MASEK, W. J., AND PATERSON, M.S. A faster algorithm for computing string-edit distances. J. Comput. Syst. Sci. 20, } (1980), 18-31.
[9]
MASEK, W. J., AND PATERSON, M. S. How to compute string-edit distances quickly. D. Sankoff and j. B. Kruskal, eds. In Time Warps, String Edzts, and Macromolecules: The Theoly and Practice of Sequence Comparison. Addison-Wesley, Reading, Mass., 1983, pp. 337-349.
[10]
MILLER. W. Efficient searching of biosequence databases. Tech. Rep. CS-88-34, Dept. Comput. Sci., The Pennsylvania State Univ., University Park, Pa, I988.
[11]
MYERS, E. W., AND MILLER, W. Approximate matching of regular expressions. Bull. Math. Biol. 51, 1 (1989), 5-37.
[12]
PENELLO, T.J. Very fast LR parsing. ACM SIGPLAN Notices 21, 7 (1986), 145-150.
[13]
SEDGEWrCK, R. Algorithms. Addison-Wesley, Reading, Mass., 1973.
[14]
THOMPSON, K. Regular expression search algorithm. Comrnun. ACM 11, 6 (June 1968), 419-422.
[15]
WAGNER, R. A., AND FISCHER, M.J. The string-to-string correction problem. J. ACM 21, 1 (Jan. 1974), 168-173.
[16]
WAGNER, e. A., AND SEIFERAS, J.I. Correcting counter-automaton-recognizable languages. SIAM. J. Comput. 7, 3 (1978), 357-375.

Cited By

View all
  • (2024)Distinct Shortest Walk Enumeration for RPQsProceedings of the ACM on Management of Data10.1145/36516012:2(1-22)Online publication date: 14-May-2024
  • (2023)Parallelization on a Minimal Substring Search Algorithm for Regular ExpressionsIEICE Transactions on Information and Systems10.1587/transinf.2022EDP7105E106.D:5(952-958)Online publication date: 1-May-2023
  • (2023)Faster Algorithms for Text-to-Pattern Hamming Distances2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS57990.2023.00136(2188-2203)Online publication date: 6-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Journal of the ACM
Journal of the ACM  Volume 39, Issue 2
April 1992
196 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/128749
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 April 1992
Published in JACM Volume 39, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Four Russians paradigm
  2. finite automaton
  3. node listing
  4. regular expression

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)108
  • Downloads (Last 6 weeks)21
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Distinct Shortest Walk Enumeration for RPQsProceedings of the ACM on Management of Data10.1145/36516012:2(1-22)Online publication date: 14-May-2024
  • (2023)Parallelization on a Minimal Substring Search Algorithm for Regular ExpressionsIEICE Transactions on Information and Systems10.1587/transinf.2022EDP7105E106.D:5(952-958)Online publication date: 1-May-2023
  • (2023)Faster Algorithms for Text-to-Pattern Hamming Distances2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS57990.2023.00136(2188-2203)Online publication date: 6-Nov-2023
  • (2023)Using expression parsing and algebraic operations to generate test sequences.Journal of Systems and Software10.1016/j.jss.2023.111798204(111798)Online publication date: Oct-2023
  • (2022)A Comparative Study of Dictionary Matching with Gaps: Limitations, Techniques and ChallengesAlgorithmica10.1007/s00453-021-00851-684:3(590-638)Online publication date: 1-Mar-2022
  • (2022)From regular expression matching to parsingActa Informatica10.1007/s00236-022-00420-659:6(709-724)Online publication date: 1-Dec-2022
  • (2021)Network Intrusion Detection System in Latest DFA Compression Methods for Deep Packet ScrutingDesign, Applications, and Maintenance of Cyber-Physical Systems10.4018/978-1-7998-6721-0.ch010(219-243)Online publication date: 25-Jun-2021
  • (2021)Text Indexing for Regular Expression MatchingAlgorithms10.3390/a1405013314:5(133)Online publication date: 23-Apr-2021
  • (2021)A New Finite Automata Construction Using a Prefix and a Suffix of Regular ExpressionsIEICE Transactions on Information and Systems10.1587/transinf.2020FCP0010E104.D:3(381-388)Online publication date: 1-Mar-2021
  • (2021)On the size of partial derivatives and the word membership problemActa Informatica10.1007/s00236-021-00399-658:4(357-375)Online publication date: 1-Aug-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media