# Efficient string matching

@article{Aho1975EfficientSM, title={Efficient string matching}, author={Alfred V. Aho and Margaret John Corasick}, journal={Communications of the ACM}, year={1975}, volume={18}, pages={333 - 340} }

This paper describes a simple, efficient algorithm to locate all occurrences of any of a finite number of keywords in a string of text. The algorithm consists of constructing a finite state pattern matching machine from the keywords and then using the pattern matching machine to process the text string in a single pass. Construction of the pattern matching machine takes time proportional to the sum of the lengths of the keywords. The number of state transitions made by the pattern matching… Expand

#### Figures and Topics from this paper

#### 2,956 Citations

A Method for Improving String Pattern Matching Machines

- Computer Science
- IEEE Transactions on Software Engineering
- 1984

This correspondence describes an efficient string pattern matching machine to locate all occurrences of any of a finite number of keywords and phrases in an arbitrary text string. Some conditions are… Expand

PATTERN MATCHING MACHINES FOR REPLACING SEVERAL CHARACTER STRINGS

- Computer Science
- 1984

A pattern matching machine which detects all occurrences of the longest possible keywords in a text and replaces them with the corresponding keywords and considers the time complexity of the algorithms and evaluation of the running time. Expand

An Efficient Implementation of Static String Pattern Matching Machines

- Computer Science
- IEEE Trans. Software Eng.
- 1989

A technique for implementing a static transition table of a string pattern matching machine which locates all occurrences of a finite number of keywords in a string is described and can be speeded up by a finite straight program without loops. Expand

An efficient implemenatation of string pattern matching machines for a finite number of keywords

- Computer Science
- SIGF
- 1989

A method of implementing a static transition table of a string pattern matching machine to locate all occurrences of a finite number of keywords in a text string by combining the fast access of an array representation with the compactness of a list structure. Expand

A string pattern - matching algorithm

- Computer Science
- J. Syst. Softw.
- 1993

A string patternmatching algorithm using a mapping table and an automaton to search another character string, text, for the first or all occurrence(s) of the pattern in the text. Expand

A Fast String-Searching Algorithm for Multiple Patterns

- Mathematics, Computer Science
- Inf. Process. Manag.
- 1993

This work combines the ideas of the Aho-Corasick and Boyer-Moore algorithms to present an efficient string searching algorithm for multiple patterns that runs in sublinear time, on the average, as the BM algorithm achieves, and its preprocessing time is linear proportional to the sum of the lengths of the patterns like the AC algorithm. Expand

Fast Pattern Matching in Strings

- Mathematics, Computer Science
- SIAM J. Comput.
- 1977

An algorithm is presented which finds all occurrences of one given string within another, in running time proportional to the sum of the lengths of the strings, showing that the set of concatenations of even palindromes, i.e., the language $\{\alpha \alpha ^R\}^*$, can be recognized in linear time. Expand

Approximate string matching: a simpler faster algorithm

- Mathematics, Computer Science
- SODA '98
- 1998

We give two algorithms for finding all approximate matches of a pattern in a text, where the edit distance between the pattern and the matching text substring is at most k. The first algorithm, which… Expand

A practical method for implementing string pattern matching machines

- Computer Science
- Inf. Sci.
- 1992

It is shown by theoretical and empirical observations that the pattern matching machine by the presented structure is about 33% smaller and about 1.3 times faster than that by the triple array. Expand

Approximate string matching with suffix automata

- Mathematics, Computer Science
- Algorithmica
- 2005

A newO(kn) algorithm for approximate string matching problem, wheren is the length of the text, based on the suffix automaton with failure transitions and on the diagonalwise monotonicity of the edit distance table is given. Expand

#### References

SHOWING 1-10 OF 24 REFERENCES

Fast Pattern Matching in Strings

- Mathematics, Computer Science
- SIAM J. Comput.
- 1977

An algorithm is presented which finds all occurrences of one given string within another, in running time proportional to the sum of the lengths of the strings, showing that the set of concatenations of even palindromes, i.e., the language $\{\alpha \alpha ^R\}^*$, can be recognized in linear time. Expand

STRING-MATCHING AND OTHER PRODUCTS

- Mathematics
- 1974

Abstract : The string-matching problem considered is to find all occurrences of a given pattern as a substring of another longer string. When the pattern is simply a given string of symbols, there is… Expand

Programming Techniques: Regular expression search algorithm

- Computer Science
- CACM
- 1968

A method for locating specific character strings embedded in character text is described and an implementation of this method in the form of a compiler is discussed. The compiler accepts a regular… Expand

Automatic generation of efficient lexical processors using finite state techniques

- Computer Science
- CACM
- 1968

The practical application of the theory of finite-state automata to automatically generate lexical processors is dealt with in this tutorial article by the use of the AED RWORD system, developed at… Expand

The Design and Analysis of Computer Algorithms

- Computer Science
- 1974

This text introduces the basic data structures and programming techniques often used in efficient algorithms, and covers use of lists, push-down stacks, queues, trees, and graphs. Expand

Implementation of the substring test by hashing

- Computer Science
- CACM
- 1971

Tradeoff curves are developed to show minimal cost of file usage by grouping various partially combined indices under conditions offile usage with different fractions of retrieval and update. Expand

Microtext: the design of a microprogrammed finite state search machine for full-text retrieval

- Computer Science
- AFIPS '72 (Fall, part I)
- 1972

The Microtext system represents a new approach to the design and implementation of a full-text retrieval system that integrates hardware, firmware, and software components in an attempt to provide a solution to the problems involved in processing large files of unformatted textual data. Expand

Derivatives of Regular Expressions

- Computer Science
- JACM
- 1964

In this paper the notion of a derivative of a regular expression is introduced atld the properties of derivatives are discussed and this leads, in a very natural way, to the construction of a state diagram from a regularexpression containing any number of logical operators. Expand

A system for typesetting mathematics

- Computer Science
- CACM
- 1975

The design and implementation of a system for typesetting mathematics, designed to be easy to learn and to use by people who know neither mathematics nor typesetting, is described. Expand

Regular Expressions and State Graphs for Automata

- Mathematics, Computer Science
- IRE Trans. Electron. Comput.
- 1960

Algorithms are presented for 1) converting a state graph describing the behavior of an automaton to a regular expression describing the behavior of the same automaton (section 2), and 2) for… Expand