gpt4 book ai didi

C++/STL 字符串 : How to mimic regex like function with wildcards?

转载 作者:搜寻专家 更新时间:2023-10-31 00:23:08 27 4
gpt4 key购买 nike

我想使用通配符比较 4 个字符串。

例如:

std::string wildcards[]=
{"H? ", "RH? ", "H[0-5] "};
/*in the last one I need to check if string is "H0 ",..., and "H5 " */

只用STL就可以实现吗?

谢谢,阿曼。

编辑:

我们可以不用 boost.regex 吗?
或者我应该向我的项目添加另一个库依赖项吗?:)

最佳答案

使用Boost.Regex

关于C++/STL 字符串 : How to mimic regex like function with wildcards?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2471651/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com