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; 

Comments

  1. It is very nice to read your site, thank you very much for your work, it’s great!
    PHP MySQL MongoDB HTML Javascript NodeJS
    ExpressJS

    ReplyDelete

Post a Comment

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -