fork(1) download
  1. #include <iostream>
  2. #include <regex>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. regex rex1("[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}([^\\\\]*)");
  8. string s("Ffs\\2FA2A6DA-11D5-4dc3-999A-749648B03C56PiSmmIpl\\2FA2A6DA-11D5-4dc3-999A-749648B03C56.map");
  9. smatch m;
  10. if (regex_search(s, m, rex1)) {
  11. std::cout << "Whole match: " << m[0] << std::endl;
  12. std::cout << "PiSmmIpl value: " << m[1] << std::endl;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 4464KB
stdin
Standard input is empty
stdout
Whole match: 2FA2A6DA-11D5-4dc3-999A-749648B03C56PiSmmIpl
PiSmmIpl value: PiSmmIpl