fork(1) download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string s("伊昭傑@郵件.商務");
  7. std::regex reg(R"((?:(?:[^<>()\[\].,;:\s@\"]+(?:\.[^<>()\[\].,;:\s@\"]+)*)|\".+\")@(?:(?:[^<>()\[\].,;:\s@\"]+\.)+[^<>()\[\].,;:\s@\"]{2,}))");
  8. if (regex_match(s, reg))
  9. {
  10. std::cout << "Match!" << std::endl;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 3540KB
stdin
Standard input is empty
stdout
Match!