fix bad matching against subdomains

Match for valid subdomains versus anything that comes before a period.

fixes #7