string text = "岳云鹏的对象叫铁锤";
regex pattern("(.*)的对象叫(.*)");
smatch results;
if (regex_match(text, results, pattern)) {
for (auto it = results.begin(); it != results.end(); ++it)
cout << *it << endl;
}
else {
cout << "match failed: " << text << endl;
}
// 岳云鹏的对象叫铁锤
// 岳云鹏
// 铁锤