I wouldn't use regex, create a new URL and use getHost to get the hostname and check if its ok for you. (also can check the other URL ...
Lee mas