123456789101112
#include <regex> #include <iostream> #include <string> int main() { std::regex number("^(1[0-5]|[0-9])$"); std::string input; std::cin >> input; std::cout << "your input is " << (std::regex_match(input, number)? "valid":"not valid\n"); }