#include <regex>
#include <string>
#include <iostream>
using namespace std;
int main() {
string user_pattern(":.*");
string s("test:55:last");
regex r("^.*(" + user_pattern + ")");
smatch matches;
if (regex_search(s, matches, r)) {
cout<<matches[1].str();
}
return 0;
}
I2luY2x1ZGUgPHJlZ2V4PgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0cmluZyB1c2VyX3BhdHRlcm4oIjouKiIpOwoJc3RyaW5nIHMoInRlc3Q6NTU6bGFzdCIpOwoJcmVnZXggcigiXi4qKCIgKyB1c2VyX3BhdHRlcm4gKyAiKSIpOwoJc21hdGNoIG1hdGNoZXM7CglpZiAocmVnZXhfc2VhcmNoKHMsIG1hdGNoZXMsIHIpKSB7CiAgICAJY291dDw8bWF0Y2hlc1sxXS5zdHIoKTsKCX0KICAgIHJldHVybiAwOwp9