Years and Authors of Summarized Original Work
1977; Knuth, Morris, Pratt
1977; Boyer, Moore
1994; Crochemore, Czumaj, Ga̧sieniec, Jarominek, Lecroq, Plandowski, Rytter
Problem Definition
Given a pattern string\(P = p_{1}p_{2}\ldots p_{m}\) and a text string\(T = t_{1}t_{2}\ldots t_{n}\), both being sequences over an alphabet \(\varSigma\) of size \(\sigma\), the exact string-matching (ESM) problem is to find one or, more generally, all the text positions where P occurs in T, that is, compute the set \(\{j\mid 1 \leq j \leq n - m + 1\text{ and }P = t_{j}t_{j+1}\ldots t_{j+m-1}\}\).
Both worst- and average-case complexities are considered. For the latter one assumes that pattern and text are randomly generated by choosing each character uniformly and independently from \(\varSigma\). For simplicity and practicality the assumption m = o(n) is made in this entry.
Key Results
Most algorithms that solve the ESM problem proceed in two steps: a preprocessing phase of the pattern Pfollowed by...
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Recommended Reading
Allauzen C, Crochemore M, Raffinot M (1999) Factor oracle: a new structure for pattern matching. In: SOFSEM’99, Milovy. LNCS, vol 1725, pp 291–306
Baeza-Yates RA, Gonnet GH (1992) A new approach to text searching. C ACM 35(10):74–82
Boyer RS, Moore JS (1977) A fast string searching algorithm. C ACM 20(10):762–772
Charras C, Lecroq T (2004) Handbook of exact string matching algorithms. King’s College, London
Cole R (1994) Tight bounds on the complexity of the Boyer-Moore string matching algorithm. SIAM J Comput 23(5):1075–1091
Cole R, Hariharan R, Paterson M, Zwick U (1995) Tighter lower bounds on the exact complexity of string matching. SIAM J Comput 24(1):30–45
Crochemore M (1992) String-matching on ordered alphabets. Theor Comput Sci 92(1):33–47
Crochemore M, Perrin D (1991) Two-way string matching. J ACM 38(3):651–675
Crochemore M, Czumaj A, Ga̧sieniec L, Jarominek S, Lecroq T, Plandowski W, Rytter W (1994) Speeding up two string matching algorithms. Algorithmica 12(4/5):247–267
Crochemore M, Hancart C, Lecroq T (2007) Algorithms on strings. Cambridge University Press, New York
Faro S, Lecroq T (2013) The exact online string matching problem: a review of the most recent results. C ACM, Harlow, 45(2):13
Fredriksson K, Grabowski S (2005) Practical and optimal string matching. In: Proceedings of SPIRE’2005, Buenos Aires. LNCS, vol 3772, pp 374–385
Galil Z, Seiferas J (1983) Time-space optimal string matching. J Comput Syst Sci 26(3):280–294
Gusfield D (1997) Algorithms on strings, trees and sequences. Cambridge University Press, New York
Hancart C (1993) On Simon’s string searching algorithm. Inf Process Lett 47(2):95–99
Horspool RN (1980) Practical fast searching in strings. Softw Pract Exp 10(6):501–506
Hume A, Sunday DM (1991) Fast string searching. Softw Pract Exp 21(11):1221–1248
Knuth DE, Morris JH Jr, Pratt VR (1977) Fast pattern matching in strings. SIAM J Comput 6(1):323–350
Morris JH Jr, Pratt VR (1970) A linear pattern-matching algorithm. Report 40, University of California, Berkeley
Navarro G, Raffinot M (1998) A bit-parallel approach to suffix automata: fast extended string matching. In: Farach-Colton M (ed) Proceedings of the 9th annual symposium on combinatorial pattern matching, Piscataway. Lecture notes in computer science, vol 1448. Springer, Berlin, Piscataway, New Jersey, USA, pp 14–33
Navarro G, Raffinot M (2002) Flexible pattern matching in strings – practical on-line search algorithms for texts and biological sequences. Cambridge University Press, Cambridge
Rytter W (2003) On maximal suffixes and constant-space linear-time versions of KMP algorithm. Theor Comput Sci 299(1–3):763–774
Smyth WF (2002) Computing patterns in strings. Addison Wesley Longman, Harlow
Sunday DM (1990) A very fast substring search algorithm. C ACM 33(8):132–142
Wu S, Manber U (1992) Fast text searching allowing errors. C ACM 35(10):83–91
Yao A (1979) The complexity of pattern matching for a random string. SIAM J Comput 8:368–387
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer Science+Business Media New York
About this entry
Cite this entry
Crochemore, M., Lecroq, T. (2016). String Matching. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_365
Download citation
DOI: https://doi.org/10.1007/978-1-4939-2864-4_365
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4939-2863-7
Online ISBN: 978-1-4939-2864-4
eBook Packages: Computer ScienceReference Module Computer Science and Engineering