#include <regex>
#include <string>
#include <iostream>
using namespace std;
int main() {
std::regex expression(R"(am\s+(\d+))");
std::smatch match;
std::string what("I am 5 years old.");
if (regex_search(what, match, expression))
{
cout << match.str(1) << endl;
}
return 0;
}
I2luY2x1ZGUgPHJlZ2V4PgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0ZDo6cmVnZXggZXhwcmVzc2lvbihSIihhbVxzKyhcZCspKSIpOwoJc3RkOjpzbWF0Y2ggbWF0Y2g7CglzdGQ6OnN0cmluZyB3aGF0KCJJIGFtIDUgeWVhcnMgb2xkLiIpOwoJaWYgKHJlZ2V4X3NlYXJjaCh3aGF0LCBtYXRjaCwgZXhwcmVzc2lvbikpCgl7CgkgICAgIGNvdXQgPDwgbWF0Y2guc3RyKDEpIDw8IGVuZGw7Cgl9CiAgICByZXR1cm4gMDsKfQ==