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.
精彩评论