fork download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6. if (regex_match("test", regex("^[_a-z0-9]{3,12}$"))) {
  7. cout << "match" << endl;
  8. } else {
  9. cout << "no match" << endl;
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 3552KB
stdin
Standard input is empty
stdout
match