Personnel was modifying a regex to validate only specific domains that end with yahoo.com.br, terra.com.br, bol.com.br, hotmail.com.br. So gmail.com, or Provider.net.br would be invalid.
Then I made the regex below:
const std::regex pattern("([a-zA-Z0-9._]+@[hotmail|terra|yahoo|bol]+(?:[.][com]{2,4})?(?:[.][br]{1,2})?)");
But you are also validating mail that ends only with .com
or if I type: [email protected]
it validates and could not validate.
I have tried to do this as follows:
const std::regex pattern("([a-zA-Z0-9._]+@(?:[hotmail.com.br|terra.com.br|yahoo.com.br|bol.com.br]{2,4})?)");
But then it returns everything invalid. Any suggestions?