ここで std::regex クラスを強制的に適合させるだけです:)。
int main() {
#ifdef APPROACH_1
int num, den;
char c;
std::cin >> num >> c >> den;
std::cout << static_cast<double>(num)/den;
#else
std::regex regex("( *)([0-9]+)( *)/( *)([0-9]+) *");
std::string inputstr;
std::smatch match;
std::cout << "Enter string";
std::getline(std::cin, inputstr);
bool matched = std::regex_search(inputstr, match, regex);
if(matched)
{
std::string nums = std::string(match[2].first, match[2].second);
std::string dens = std::string(match[5].first, match[5].second);
std::cout << nums << " " << dens << std::endl;
std::stringstream ss1(nums), ss2(dens);
int num, den;
ss1 >> num;
ss2 >> den;
std::cout << static_cast<double>(num)/den;
}
else
std::cout << "Oops" << std::endl;
#endif
}