/^[_a-z0-9]+(\.[_a-z0-9]+)*[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,7})$/
That's the pattern. It says "ok" when it's correct, and "not ok" when it's incorrect. So it says "ok" on www.google.com, but "not ok" when I type http://www.google.com
What I'd like is this pattern to allow http:// too, but it should never be a requirement.