I am not sure if I completely understand what is returned by std::match_results::size. According to cppreference it "Returns the number of submatches
std::match_results::size