Writing in news:alt.www.webmaster
From the safety of the Castle Amber - software development cafeteria
John Bokma <john.TakeThisOut@castleamber.com> said:
> ...
> for ( $domain ) {
>
> # remove sub domain
> s/www?\d?\.([^\.]+\.)/$1/g; # common ww(w)(\d) prefix
> s/.+\.([^\.]+\.[a-z]{3})$/$1/g;
> s/.+\.([^\.]+\.[^\.]+\.[a-z]{2})$/$1/g;
> }
thanks, but ...
> is what I used for a project. Note: it's far from perfect
.
yes, having thought on it some more I'm coming to the conclusion it cannot
be done purely with logic.
As these domains are all known to me I think I'll have to do a match
against a data store - splitting the hostname and starting at the back,
adding elements till I find a match.
Really can't think of anything else that is guaranteed to work (for an
acceptable value of 'work')
--
William Tasso
** Business as usual
>> Stay informed about: extracting the domain name