fork download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. string texto = "gabriel = 1.73,derp = 1.80,";
  8. regex padrao("gabriel = (.*?),");
  9. cout << regex_replace(texto, padrao, "gabriel = 1.75,");
  10. return 0;
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/50418/101
Success #stdin #stdout 0s 15344KB
stdin
Standard input is empty
stdout
gabriel = 1.75,derp = 1.80,