String match
String matching is the computational task of locating or comparing character sequences according to a specified exact or approximate matching criterion.
Algorithms Every Programmer Should Know
String matching is the computational task of locating exact or approximate occurrences of one character sequence within another.
- How it is used
- Locates a pattern within text and supports plagiarism screening across large document collections.
- How deep it goes
- Works from direct character comparisons through rolling hashes and collision checks, but does not detail semantic matching internals.
- Examples
- Compares COOL against ALICEANDJOEBAKEDCOOKIES and applies fingerprinting to plagiarism checks across document collections.
- What you can do after
- Apply Rabin–Karp to find pattern positions by hashing text windows and verifying character matches.
Read how Algorithms Every Programmer Should Know explains string match →
Natural Language Processing in Action, Second Edition
String matching is the process of finding exact or approximate occurrences or correspondences between character sequences.
- How it is used
- Uses character-sequence matching to power lightweight NLP pipelines, chatbots, question-answering systems, and task-execution assistants.
- How deep it goes
- Connects regular expressions to efficiently parsable regular languages, then demonstrates brute-force edit-distance retrieval without tokenization.
- Examples
- Shows ChatterBot statement retrieval, Will regular-expression rules, and Salvius conversational behavior.
- What you can do after
- Apply string matching to retrieve responses by brute-force search or route assistant inputs through regular-expression rules.
Read how Natural Language Processing in Action, Second Edition explains string match →
Also covered in
- Learn AI-Assisted Python Programming, Second Edition
- Learn Concurrent Programming with Go
- Learn SQL in a Month of Lunches
- Object-Oriented Software Design in C++
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
Related concepts
- Knuth-Morris-Pratt algorithmincludes · The Knuth-Morris-Pratt algorithm is a string-search procedure that avoids rechecking previously matched text characters by using information about the pattern's prefixes and suffixes.
- Rabin-Karp algorithmincludes · The Rabin-Karp algorithm is a string-searching algorithm that compares hash values of a pattern and text windows before verifying candidate matches character by character.
- Boyer-Moore-Horspool algorithmincludes · The Boyer-Moore-Horspool algorithm is a string-search procedure that compares pattern characters from right to left and shifts the pattern according to the mismatching text character.
- evaluationused by · Evaluation is the systematic assessment of a system, model, process, or outcome against relevant criteria or objectives using evidence.
- exact-match accuracycontrasts with · Exact-match accuracy is the proportion of predictions or outputs that equal their reference answers under specified comparison rules.
Questions about string match
What is string match?
String matching is the computational task of locating or comparing character sequences according to a specified exact or approximate matching criterion.
Which Manning books explain string match?
Algorithms Every Programmer Should Know and Natural Language Processing in Action, Second Edition.
What should I know before learning string match?
Manning books that teach string match usually introduce function, language model and Python first.
What is the difference between string match and exact-match accuracy?
String matching is the computational task of locating or comparing character sequences according to a specified exact or approximate matching criterion. Exact-match accuracy is the proportion of predictions or outputs that equal their reference answers under specified comparison rules.
What kinds of string match are there?
Kinds of string match include Knuth-Morris-Pratt algorithm, Rabin-Karp algorithm and Boyer-Moore-Horspool algorithm.
What is string match also called?
String match is also called string matching.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

