fork(5) download
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string s = "x";
  10.  
  11. s = regex_replace(s + "0123456789", regex("(\\b(?=9.*(1))|0(?=.*(1))|1(?=.*(2))|2(?=.*(3))|3(?=.*(4))|4(?=.*(5))|5(?=.*(6))|6(?=.*(7))|7(?=.*(8))|8(?=.*(9))|9(?=.*(0)))(?=9*-)|\\d{10}$"), "$2$3$4$5$6$7$8$9$10$11$12");
  12. cout << s << '\n';
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 3552KB
stdin
Standard input is empty
stdout
x1