Can boost :: regex_search run on wstring?

This is what I tried:

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; } 
+7
c ++ boost regex
source share
2 answers

use wregex and wsmatch

+14
source share

I think so, but you need to use boost::wsmatch instead of smatch and wregex .

+2
source share

All Articles