From an email address like [email protected]
I want to fetch domain name gmail.com
.
i want to use that pattern on textbox value in Javascript.
Pease suggest me an optimized and faster preg pattern for above requirement...
You can replace everything up to and including the @
symbol to get the domain. In Javascript:
var email = '[email protected]';
var domain = email.replace(/.*@/, "");
alert(domain);