Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Split the url first and last

hsemarJan 25 2018 — edited Jan 26 2018

Hi,

I'm working on a regular expression  to pull the  websites url first and last.

I'm trying to pull the website information and last page information.  if i have a url   as   https://www.google.com/slikc.aspx?738rhf84ugs      i have to grab the   www.google.com in one field and  2nd field as   slikc.aspx

Sample data

create table test_table (url varchar2(4000));

insert into test_table(url) values ('https://community.oracle.com/discussion/create.jspa?containerType=14&containerID=3077&customTheme=otn&draftID=2341586');

insert into test_table(url) values ('http://google.com/');

insert into test_table(url) values ('https://www.google.com/search?source=hp&ei=7Z5qWpiwJ8zuzgLa-aOYAQ&q=otn+forums&oq=&gs_l=psy-ab.1.0.35i39k1l6.0.0.0.32');

insert into test_table(url) values ('http://bit.lit/timeandatt.aspx');

Result:

first
last
community.oracle.comcreate.jspa
google.com
www.google.comsearch
bit.littimeandatt.aspx

Regards,

Ramesh G

This post has been answered by Etbin on Jan 26 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2018
Added on Jan 25 2018
6 comments
961 views