vous devez utiliser la correspondance "sans capture" ? :pour faire face aux sites Web non "http://"
comme
select
id,
substring(website from '(?:.*://)?(?:www\.)?([^/]*)')
as website_domain
from contacts
http://sqlfiddle.com/#!17/197fb/14
https://www.postgresql.org /docs/9.3/static/functions-matching.html#POSIX-ATOMS-TABLE