user373215 user373215 - 4 months ago 36
C++ Question

API For KMP or Boyer-Moore string pattern matching in C++ / STL?

Wondering, if I want to replace strstr with a better string matching algorithm, like KMP or Boyer Moore, is there one in C++ or do we have to write on our own?

Wondering, what is the practical string matching function that everyone uses other than strstr?

This is with respect to C++/STL under Unix/Linux platform.


I haven't seen many that use features specific to C++, but there are quite a few implementations of KMP and (especially) variants of Boyer-Moore (e.g., Boyer-Moore-Horspool) around that are easily usable from C++.