Re: Extracting hostname from URI column

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Extracting hostname from URI column
Дата
Msg-id 873axekxlr.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Extracting hostname from URI column  (Paul Lambert <paul.lambert@autoledgers.com.au>)
Ответы Re: Extracting hostname from URI column  (Andrew Sullivan <ajs@crankycanuck.ca>)
Список pgsql-sql
"Paul Lambert" <paul.lambert@autoledgers.com.au> writes:

> What would be the best way to do something like that? I assume it won't be a
> simple regex like the above due to the country codes on the end of some
> domains. My thought is look at the last portion of the domain, if it's 2
> characters long then assume it's a country code and grab the last three
> sections, if it's not three characters long then assume it's an international
> domain and grab the last two... but that sounds a bit dodgy.

Not all countries break up their national tld space into sections like .co.uk
or .com.au. Canadian domains can be bought directly under .ca like amazon.ca.

I think you'll have to store a specific list of tlds and how deep you want to
look.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


В списке pgsql-sql по дате отправления:

Предыдущее
От: Paul Lambert
Дата:
Сообщение: Re: Extracting hostname from URI column
Следующее
От: "Stanislas de Larocque"
Дата:
Сообщение: Re: Optimize querry sql