boost::regex re;
re = "(\\d+)";
boost::cmatch matches;
if (boost::regex_search("hello 123 world", matches, re))
{
printf("Found %s\n", matches[1]);
}
結果:「世界123個発見」。「123」が欲しかっただけです。これはヌル終了の問題ですか、それとも regex_search の仕組みを誤解しているだけですか?