1
Staff was modifying a regex to validate only specific domains ending with yahoo.com.br, terra.com.br, bol.com.br, Hotmail.com.br. Then gmail.com, or provider.net.br would be invalid.
So I did the regex below:
const std::regex pattern("([a-zA-Z0-9._]+@[hotmail|terra|yahoo|bol]+(?:[.][com]{2,4})?(?:[.][br]{1,2})?)");
But it is also validating email that ends only with .com
or if I type: [email protected]
it validates and could not validate.
I’ve tried to do it this way:
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 all invalid. Any suggestions?
very good now based on this I will write another to validate domains .net.org.br
– dark777