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

int main() {
    std::regex regx("\\$(\\w+)\\$(\\d+)"); 
    std::string inString("$C$5:$F$89");
    std::vector<std::string> vecCol;
    std::vector<std::string> vecRow;

    for(std::sregex_iterator i = std::sregex_iterator(inString.begin(), inString.end(), regx);
                             i != std::sregex_iterator();
                             ++i)
    {
	    std::smatch match = *i;
	    std::cout << "Whole match: " << match.str() << ", Group 1: " << match.str(1) << ", and Group 2: " << match.str(2) << '\n';
	    //add them to the vecs
        vecCol.push_back(match.str(1));
        vecRow.push_back(match.str(2));
    }
        
	return 0;
}