我有一些boost的regex代碼,我認爲應該觸發。我是新來的助推器,但我知道一點正則表達式。這是我正在使用的代碼。Boost :: regex_match沒有觸發
re = boost::basic_regex<TCHAR>(_T("-+\\s+Original\\s+Message\\s+-+"), boost::regex_constants::icase);
boost::match_results<TSTRING::const_iterator> result;
if(boost::regex_match(RawBody, result, re))
這裏是我正在使用的測試字符串。
this is a test
-------- Original Message --------
everything under here should disappear
我的代碼編譯並運行,它只是不會觸發if語句。我試圖調試到升壓代碼和...是...
使用regex_search而不是regex_match。 – ForEveR 2012-08-01 20:59:28