开发者

Can boost::regex_search be done on a wstring?

This is what I tried:

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

    bo开发者_运维技巧ost::regex exp("^.*?PRIVMSG #.*? :(.+)");
    boost::smatch match;

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

    return text;
    }


use wregex and wsmatch


I believe so, but you'll need to use boost::wsmatch instead of smatch, and wregex as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜