
"Flexible pattern matching in strings" by Gonzalo Navarro and Mathieu Raffinot.
A rare book that marries the theoretical and practical. It has good worked examples.
https://www.cambridge.org/core/books/flexible-pattern-matchi...
One of my favorite things about it is that it has a "phase change" graph at the end of each chapter, saying for each combination of alphabet size and pattern size, which algorithm fares better. It also favors algorithms that are simple to implement (such as Horspool instead of Boyer-Moore), because those also tend to be the fastest.
And also "Flexible Pattern Matching in Strings" by Navarro and Raffinot.
The algorithm itself looks very similar to the one used in agrep proposed by Wu and Manber [1].
I also found the book "Flexible Pattern Matching in Strings" to be a very good reference on all things related to pattern matching [2].
[1] S. Wu and U. Manber. A fast algorithm for multi-pattern searching. Report TR-94-17, Department of Computer Science, University of Arizona, 1994.
[2] http://www.amazon.com/Flexible-Pattern-Matching-Strings-Line...