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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With