fork(1) download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. string s("0.123,0.432,0.123,ABC");
  8. regex r("[^,]+$");
  9. smatch matches;
  10. if (regex_search(s, matches, r)) {
  11. cout<<matches.str();
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 4260KB
stdin
Standard input is empty
stdout
ABC