find domain name from any url by regular expression

Parvendra
Posted by Parvendra under Regular Expressions category on | Views : 4528
Below written regular expression will fetch domainname.com string from any url


regex = "/.*@(.*)$/";

for example from sting "testname@testdomain.com" it will return testdomain.net.

Comments or Responses

Login to post response