From the question and comments, I'll assume the starting point is a std::string
like:
std::string color { " ( 123, 1, 45 ) " };
The goal is to substract those numbers and convert them into integers. Let's first remove the white spaces:
color.erase(std::remove_if(color.begin(), color.end(), ::isspace), color.end());
We can now extract the numbers as strings:
std::regex reg("\\,");
std::vector<std::string> colors(
std::sregex_token_iterator(++color.begin(), --color.end(), reg, -1),
std::sregex_token_iterator()
);
Finally, convert them to integers:
std::vector<int> integers;
std::transform(colors.begin(), colors.end(), std::back_inserter(integers),
[](const std::string& str) { return std::stoi(str); });