API 用于 C++ 中的 KMP 或 Boyer-Moore 字符串模式匹配/STL?

发布于 2024-09-13 17:23:50 字数 160 浏览 2 评论 0原文

想知道,如果我想用更好的字符串匹配算法(例如 KMP 或 Boyer Moore)替换 strstr,C++ 中有吗?还是我们必须自己编写?

想知道除了strstr之外大家都用的实用的字符串匹配函数是什么?

这是针对 Unix/Linux 平台下的 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拔了角的鹿 2024-09-20 17:23:50

我还没有看到很多使用特定于 C++ 的功能,但是有相当多的 KMP 实现和(特别是)Boyer-Moore 的变体(例如 Boyer-Moore-Horspool) 周围可以轻松地从 C++ 中使用。

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++.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文