gpt4 book ai didi

c++ - boost::regex_search 可以在 wstring 上完成吗?

转载 作者:可可西里 更新时间:2023-11-01 18:16:35 25 4
gpt4 key购买 nike

这是我尝试过的:

std::wstring extractText(std::wstring line) {
std::wstring text;

boost::regex exp("^.*?PRIVMSG #.*? :(.+)");
boost::smatch match;

if (boost::regex_search(line, match, exp)) {
text = std::wstring(match[1].first, match[1].second);
}

return text;
}

最佳答案

使用 wregex 和 wsmatch

关于c++ - boost::regex_search 可以在 wstring 上完成吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4371479/

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