c++ regex to validate indian phone number pattern code example
Example 1: regex for phone number c++
std::regex r("\\(\\d{3}\\) \\d{3}-\\d{4}"); // e.g. "(012) 345-6789"
auto isValidPhoneNumber = std::regex_match(phone_num_str, r);
Example 2: c++ regex to validate indian phone number pattern
Copy Code^([+][9][1]|[9][1]|[0]){0,1}([7-9]{1})([0-9]{9})$