> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > $domain =~ m/((\w+)\.(\w+)$)/;
> > And $1 did indeed only have 'domain.com'
> > Then I realized, what about tld's like com.uk like yahoo.com.ru 
> > google.com.uk
> 
> Try
> 
>  my($dom) = $URI =~ m{://([^/:]+)};
> 
> If $URI = 
> "http://some.server.com.uk:1540/other/stiff.cg> i?here" it'll work. :) 

Hmm, if I'm looking at it right wouldn't that grab everything after :// and before the 
first / ie
some.server.com.uk

Which is the sam as doing 
my $dom = $uri->host();

What I was trying to get was just the domain without any subdomains, ie what you would 
register with a registrar
So what I was doing worked for a domain.com or domain.org, because it grabbed the last 
two chunks of text with a period in between. So with hello.domain.com I got domain.com 
but with domain.com.uk I'd only get com.uk which is not good.

What I was loking for was module like uri that would return just that part - 
server.com.uk

Thanks
Dan
 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day 
http://shopping.yahoo.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to