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

int main() {
    std::string l_strHexValue = "#FF0000";
    std::regex pattern("#([0-9a-fA-F]{6})\\b");
    std::smatch match;
    if (std::regex_match(l_strHexValue, match, pattern))
    {
		int r, g, b;
		sscanf(match.str(1).c_str(), "%2x%2x%2x", &r, &g, &b);
        std::cout << "R: " << r << ", G: " << g << ", B: " << b << "\n";
    }

    return 0;
}