
24 Jul
2006
24 Jul
'06
10:29 p.m.
Torsten Landschoff wrote:
boost::smatch sm; BOOST_REGEX_TEST(boost::regex_match(std::string(text), sm, re));
Here is your problem. You're performing a match on a temporary std::string. After regex_match returns, sm will be left holding iterators into a destroyed string. Try: std::string str(text); BOOST_REGEX_TEST(boost::regex_match(str, sm, re)); instead. -- Eric Niebler Boost Consulting www.boost-consulting.com