यह है कि मैं क्या करने की कोशिश की है:बढ़ा सकते हैं :: regex_search wstring पर किया जा सकता है?
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;
}
और जब आपने कोशिश की तो क्या हुआ? – aschepler
त्रुटि C2784: 'बूल बूस्ट :: regex_search (const std :: basic_string और, कॉन्स बूस्ट :: basic_regex और, boost :: regex_constants :: match_flag_type)': 'const boost के लिए टेम्पलेट तर्क को कम नहीं कर सका :: basic_regex और 'से' बूस्ट :: smatch ' –
coolface
मुझे विश्वास है कि जब आप' std :: wstring' का उपयोग करते हैं, तो आपको boost.regex के 'w' रूपों का उपयोग करना होगा, जैसे 'boost :: wregex' और 'boost :: wsmatch'। इसके अलावा, यदि आप यूनिकोड मिलान कर रहे हैं, तो इस लिंक को देखें: http://www.boost.org/doc/libs/1_45_0/libs/regex/doc/html/boost_regex/unicode.html – birryree