Skip to main content

String Matching Algorithm

  • Reference work entry
Encyclopedia of Machine Learning
  • 172 Accesses

A string matching algorithm returns parts of text matching a given pattern, such as a regular expression. Such algorithms have countless applications, from file editing to bioinformatics. Many algorithms compute deterministic finite automata, which can be expensive to build, but are usually efficient to use; they include the Knuth–Morris–Pratt algorithm and the Boyer–Moore algorithm, that build the automaton in time O(m) and O(m + s), respectively, where m is the length of the pattern and s the size of the alphabet, and match a text of length n in time O(n) in the worst case.

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

Access this chapter

Institutional subscriptions

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer Science+Business Media, LLC

About this entry

Cite this entry

(2011). String Matching Algorithm. In: Sammut, C., Webb, G.I. (eds) Encyclopedia of Machine Learning. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-30164-8_791

Download citation

Publish with us

Policies and ethics