[PHP] Re: eregi expression for checking a domain

2005-03-14 Thread Jason Barnett
Ross Hulford wrote: > Does anyone know a working eregi expression for determining a domain is > valid? don't need the http:// just looking for www.thedomain.com > > cheers, > > > R. parse_url() http://php.net/manual/en/function.parse-url.php -- Teach a man to fish... NEW? | http://www.catb.org/

[PHP] Re: eregi expression for checking a domain

2005-03-13 Thread Jim Plush
also, note I used preg_match instead of ereg, preg is a better choice over ereg usually (flexibility, speed, etc) Ross Hulford wrote: Does anyone know a working eregi expression for determining a domain is valid? don't need the http:// just looking for www.thedomain.com cheers, R. -- PHP Gener

[PHP] Re: eregi expression for checking a domain

2005-03-13 Thread Jim Plush
this should work for any web address starting with www. // test for domain $domain = "www.example.com"; // This pattern will match anything that STARTS with www followed by a period, followed by at least 2 characters, // numbers and periods followed by a period followed by at least two characters