This should work:
[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}
The issue in the regex you're using is that you're using the greedy version "+" in the character class that includes your period. The regex I posted here checks for only a single perdiod in the name.
This pattern will successfully match google.com, www.google.com, and any arbitrary number of subdomains.
NOTE: ICANN recently announced that soon they will allow for any top-level domain (e.g. instead of just .com, .org, etc. they will soon allow .whatever), so you may need to adjust the last part of the regex, "{2,4}", since TLDs will soon be of arbitrary length.