Skip to main content

Multiple String Matching

  • Reference work entry
  • First Online:
Encyclopedia of Algorithms

Years and Authors of Summarized Original Work

  • 1975; Aho, Corasick

  • 1979; Commentz-Walter

  • 1999; Crochemore, Czumaj, Ga̧sieniec, Lecroq, Plandowski, Rytter

Problem Definition

Given a finite set of k pattern strings\(\mathcal{P} =\{ P^{1},P^{2},\ldots ,P^{k}\}\) and a text string\(T = t_{1}t_{2}\ldots t_{n}\), T and the Pis being sequences over an alphabet Σ of size σ, the multiple string matching (MSM) problem is to find one or, more generally, all the text positions where a Pi occurs in T. More precisely the problem is to compute the set \(\{j\mid \exists i,P^{i} = t_{j}t_{j+1}\ldots t_{j+\vert P^{i}\vert -1}\}\), or equivalently the set \(\{j\mid \exists i,P^{i} = t_{j-\vert P^{i}\vert +1}t_{j-\vert P^{i}\vert +2}\ldots t_{j}\}\). Note that reporting all the occurrences of the patterns may lead to a quadratic output (e.g., when Pis and T are drawn from a one-letter alphabet). The length of the shortest pattern in \(\mathcal{P}\) is denoted by \(\ell\mathit{min}\). This problem is an...

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 1,599.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 1,999.99
Price excludes VAT (USA)
  • Durable hardcover 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

Institutional subscriptions

Recommended Reading

  1. Aho AV, Corasick MJ (1975) Efficient string matching: an aid to bibliographic search. C ACM 18(6):333–340

    Article  MathSciNet  MATH  Google Scholar 

  2. Allauzen C, Crochemore M, Raffinot M (1999) Factor oracle: a new structure for pattern matching. In: SOFSEM’99. LNCS, vol 1725, Milovy, Czech Republic, pp 291–306

    Google Scholar 

  3. Belazzougui D (2012) Worst-case efficient single and multiple string matching on packed texts in the word-ram model. J Discret Algorithms 14:91–106

    Article  MathSciNet  MATH  Google Scholar 

  4. Belazzougui D, Raffinot M (2013) Average optimal string matching in packed strings. In: Spirakis PG, Serna MJ (eds) Proceedings of the 8th international conference on algorithms and complexity (CIAC 2013), Barcelona. Lecture notes in computer science, vol 7878. Springer, Barcelona, Spain, pp 37–48

    Google Scholar 

  5. Commentz-Walter B (1979) A string matching algorithm fast on the average. In: Proceedings of ICALP’79. Lecture notes in computer science vol 71. Springer, Graz, Austria, pp 118–132

    Google Scholar 

  6. Crochemore M, Czumaj A, Ga̧sieniec L, Lecroq T, Plandowski W, Rytter W (1999) Fast practical multi-pattern matching. Inf Process Lett 71(3–4):107–113

    Google Scholar 

  7. Crochemore M, Hancart C, Lecroq T (2007) Algorithms on strings. Cambridge University Press, Cambridge, New York

    Book  MATH  Google Scholar 

  8. Gusfield D (1997) Algorithms on strings, trees and sequences. Cambridge University Press, Cambridge, New York

    Book  MATH  Google Scholar 

  9. Navarro G, Raffinot M (2000) Fast and flexible string matching by combining bit-parallelism and suffix automata. ACM J Exp Algorithms 5:4

    Article  MathSciNet  MATH  Google Scholar 

  10. Navarro G, Raffinot M (2002) Flexible pattern matching in strings – practical on-line search algorithms for texts and biological sequences. Cambridge University Press, Cambridge

    Book  MATH  Google Scholar 

  11. Smyth WF (2002) Computing patterns in strings. Addison Wesley Longman, Harlow

    Google Scholar 

  12. Wu S, Manber U (1992) Agrep – a fast approximate pattern-matching tool. In: Proceedings of USENIX winter 1992 technical conference. USENIX Association, San Francisco, CA, pp 153–162

    Google Scholar 

  13. Wu S, Manber U (1994) A fast algorithm for multi-pattern searching. Report TR-94-17, Department of Computer Science, University of Arizona, Tucson

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Maxime Crochemore .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer Science+Business Media New York

About this entry

Cite this entry

Crochemore, M., Lecroq, T. (2016). Multiple String Matching. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_366

Download citation

Publish with us

Policies and ethics