I want to split the string
"Input\temp.csv:1:14"
sInpFileName = "Input\temp.csv:1:14";
regex colon(?);
vector<string> MyVector(sregex_token_iterator(sInpFileName.begin(), sInpFileName.end(), colon, 1), sregex_token_iterator());
Input\temp.csv
1
14
This should work:
std::string sInpFileName = "Input\\temp.csv:1:14";
std::regex re{"([^:]+)"};
std::regex_token_iterator<std::string::iterator> it{sInpFileName.begin(), sInpFileName.end(), re, 1};
decltype(it) end{};
while (it != end) std::cout << *it++ << std::endl;