boost::regex_search upgrade from 1_36 to 1_45

Hi I have upgraded my boost to 1_45 (it was 1_36) and since then I have an error on boost::regex_search here is the code std::string regexp = "\\^:\\([^;^]*\\);\\([^;^]*\\);\\([^^]*\\)\\^:"; boost::regex expression( regexp.c_str() , boost::regex::basic|boost::regex::icase ); std::string::const_iterator it_prev = str.begin(); std::string::const_iterator it_end = str.end(); std::string tmp; while (boost::regex_search(it_prev, what, expression)) { res = true; tmp.assign(it_prev,what[0].first); ... tmp.assign(what[2].first, what[2].second); ... reading the html doc I can not find how to rewrite this while loop. I'm not a boost expert, any help would be appreciated. Thank you

I forgot the declaration of 'what' which is boost::match_resultsstd::string::const_iterator what;

I have upgraded my boost to 1_45 (it was 1_36) and since then I have an error on boost::regex_search
What error? Compiler?
here is the code
std::string regexp = "\\^:\\([^;^]*\\);\\([^;^]*\\);\\([^^]*\\)\\^:"; boost::regex expression( regexp.c_str() , boost::regex::basic|boost::regex::icase );
std::string::const_iterator it_prev = str.begin(); std::string::const_iterator it_end = str.end(); std::string tmp; while (boost::regex_search(it_prev, what, expression))
OK, *if* std::string iterator happens to be a const char* then this will work, otherwise it won't, suggest you use: boost::smatch what; while (boost::regex_search(str, what, expression)) { //etc My guess is you upgraded compiler at the same time as updating Boost? Basically your old code compiled "by accident"... HTH, John.
participants (2)
-
EricB
-
John Maddock