#include <iostream>
#include <string>
#include <regex>
int main( )
{
std::regex rgx(":((?!.*:).*$)");
std::smatch match;
std::string input = "concept:personasia:toby_pizur:personasia:teste";
if (std::regex_search(input, match, rgx))
{
std::cout << match[1];
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8cmVnZXg+CgppbnQgbWFpbiggKQp7CiAgICBzdGQ6OnJlZ2V4IHJneCgiOigoPyEuKjopLiokKSIpOwogICAgc3RkOjpzbWF0Y2ggbWF0Y2g7CiAgICBzdGQ6OnN0cmluZyBpbnB1dCA9ICJjb25jZXB0OnBlcnNvbmFzaWE6dG9ieV9waXp1cjpwZXJzb25hc2lhOnRlc3RlIjsKCiAgICBpZiAoc3RkOjpyZWdleF9zZWFyY2goaW5wdXQsIG1hdGNoLCByZ3gpKQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCBtYXRjaFsxXTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQo=