fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4.  
  5. int main()
  6. {
  7. std::string wholePath = "\\User\\home\\Lib\\hello.cpp.h";
  8. std::regex e_1(".*\\\\.*\\\\(.*)$");
  9. std::smatch sm;
  10. std::regex_match(wholePath.cbegin(), wholePath.cend(), sm, e_1);
  11. std::cout << sm[1] << "\n";
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 3320KB
stdin
Standard input is empty
stdout
hello.cpp.h