# include <iostream>
# include <string>
{
const std::string text = "needle in a haystack with another needle";
const std::string pattern = "needle";
const auto matches = boyer_moore_horspool_search(text, pattern);
std::cout << "Boyer-Moore-Horspool Example\n";
std::cout << "Text : " << text << "\n";
std::cout << "Pattern: " << pattern << "\n\n";
std::cout << "Matches at positions: ";
if (matches.is_empty())
std::cout << "none";
else
for (size_t i = 0; i < matches.size(); ++i)
std::cout << matches[i] << (i + 1 == matches.size() ? "" : " ");
std::cout << "\n";
return 0;
}
Classical pattern searching algorithms over strings.
Main namespace for Aleph-w library functions.