I am regex noob, but I want to write a regular expression for checking email for the domain name xyz.com.it, if the user key is on abc.com or other domain domain names, it will pass. If the user keys in xyz are after @, then only xyz.com.it will pass, others, such as xyz.net.it or xyz.net, will not pass. Any idea how to do this?
I tried
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; var regexEmail = regex.test($('#email').val());
which only checks regular email
source share