I have the following possible inputs:
http://subdomain.domain.com/hello.html
http://subdomain.domain.com
https://subdomain.domain.com
subdomain.domain.com
http://domain.com/hello.html
http://domain.com
https://domain.com
domain.com
I am trying to create a regular expression that will capture and subdomain into one group and domain into another group. So given the examples above I would get the following matches:
Sub Domain Group Domain Group
--------------------------------
subdomain domain.com
subdomain domain.com
subdomain domain.com
subdomain domain.com
empty domain.com
empty domain.com
empty domain.com
empty domain.com
Use explicit capture.