You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
259 B

1 month ago
  1. #include <regex>
  2. #include <string>
  3. int main() {
  4. const std::string str = "test0159";
  5. std::regex re;
  6. re = std::regex("^[a-z]+[0-9]+$",
  7. std::regex_constants::extended | std::regex_constants::nosubs);
  8. return std::regex_search(str, re) ? 0 : -1;
  9. }