Regular Expression: ([0-9]*)|([0-9]*\.[0-9]*)
String: word1 word2 0:12:13.23456 ... example string
match: 0,12,13.23456
Requirement:
convert to a struct ->
struct Duration {
unsigned int hours;
unsigned int minutes;
double seconds;
};
Current matcher:
Duration duration;
std::regex regex("([0-9]*):([0-9]*):([0-9]*.[0-9]*)");
auto begin = std::sregex_iterator(data.begin(), data.end(), regex); // data is an std::string instance
auto end = std::sregex_iterator();
for (auto it = begin; it != end; it++) {
auto match = *it;
// how to cycle through the data values of the instance of Duration?
}