fork download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. string s = "He";
  8. if (regex_match(s, regex("[A-Za-z_][A-Za-z0-9_]*", regex_constants::basic))) {
  9. cout << "Match" << endl;
  10. }
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 3460KB
stdin
Hello this is a test
stdout
Standard output is empty