I am struggling with writing a regex for validating email address for only one domain.
I have this expression
[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}
But the issue is that for example hello@gmail.com.net
is valid and I only want to be only valid for only one domain. So hence I do not want hello@gmail.com.net
to be valid.
Help is needed. Thank you!
try this [A-Z0-9a-z._%+-]+@[A-Za-z0-9-]+\.[A-Za-z]{2,64}
.
In your regex is a dot in the allowed characters behind the @.