oracle11g - get root domain from url Oracle sql regex_substr -
i have query root domain urls below :
select regexp_substr(regexp_replace('https://creditcards.chase.com/credit-cards/bp-credit-card.aspx', '^http[s]?://(www\.)?|^www\.', '', 1), '(\.\w+)+') domain dual;
which returns out put : '.chase.com'
how can ignore first dot in outoput regex in above query?
note : need root domain, i.e, 'chase.com'
thanks.
select regexp_substr('https://creditcards.token.chase.com/credit-cards/bp-credit-card.aspx', '(^http[s]?://(www\.)?|^www\.)(\w+\.)*(\w+\.\w+)', 1, 1, 'i', 4) domain dual;
It is very nice to read your site, thank you very much for your work, it’s great!
ReplyDeletePHP MySQL MongoDB HTML Javascript NodeJS
ExpressJS