#include <string>
#include <vector>
#include <iostream>
#include <regex>
using namespace std;

int main() { 
    std::regex r("\"two\":([0-9]*)"); 
    std::vector<int> results;
    std::string s = " \"one\":\"1\", \"two\":2, \"three\":3, \"two\":22 ";
    for(std::sregex_iterator i = std::sregex_iterator(s.begin(), s.end(), r);
            i != std::sregex_iterator(); 
            ++i) 
    { 
        std::smatch m = *i; 
        results.push_back(std::stoi( m[1].str().c_str() ));
    } 
    for (auto n: results)
    	std::cout << n << std::endl;
    return 0; 
}