Added ability to pass regex or proc to determine the domain name