fork(2) download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string test_string = "\"1\" \"1.50\"\nNew line";
  7. std::regex reg_combined("\"([0-9]+\\.?[0-9]*)\"|\n");
  8. std::cout << std::regex_replace(test_string, reg_combined, "$1");
  9. return 0;
  10. }
Success #stdin #stdout 0s 4984KB
stdin
Standard input is empty
stdout
1 1.50New line