Re: Parsing for base domain

2003-11-16 Thread R. Joseph Newton
drieux wrote: > But there is this minor little problem, the fly in the ointment > > nas.nasa.gov > > it happens to BE the domain name - yes it is in the 'nasa.gov' > name space - but it is it's own domain to which the 'host' > component would be the www as in: > > www.nas.nasa.gov

Re: Parsing for base domain

2003-11-14 Thread drieux
On Friday, Nov 14, 2003, at 14:28 US/Pacific, Tim Johnson wrote: [..] use strict; use warnings; my @domains = qw(www.x.com x.com www.sandisk.com network.tv funny.co.jp johnson.pictures.geography.info); foreach(sort @domains){ if($_ =~ /([a-zA-Z0-9\-.]*?)([a-zA-Z0-9\- ]+\.(co\.\w{2}|com|net|edu|go

RE: Parsing for base domain

2003-11-14 Thread Tim Johnson
How about something like this (it's my first try, but it seems to work)... # use strict; use warnings; my @domains = qw(www.x.com x.com www.sandisk.com network.tv funny.co.jp johnson.pictures.geography.info); foreach(sort @domains){ if($_ =~ /([a-zA-Z0-9\-.]

Re: Parsing for base domain

2003-11-14 Thread Jeff 'japhy' Pinyan
On Nov 14, [EMAIL PROTECTED] said: >I would like to parse the servername to get the base domain or atleast >x.com, x.org, x.net, etc. from something like www.x.com. You're sure you won't run into www.foo.co.uk domains? >I think what I want is the value of the left and right of the last dot. Her

Re: Parsing for base domain

2003-11-14 Thread Tore Aursand
On Fri, 14 Nov 2003 01:40:35 -0800, perl wrote: > I would like to parse the servername to get the base domain or atleast > x.com, x.org, x.net, etc. from something like www.x.com. There are modules on to do this for you, but if you _only_ have the names you mentioned, you co