REGEXP validation of URL in Oracle 11

From: Rune Smedstuen <rune.smedstuen_at_gmail.com>
Date: Tue, 12 Feb 2008 01:30:32 -0800 (PST)
Message-ID: <dbb0d9b4-8314-45e5-8361-11209cfefa26@i72g2000hsd.googlegroups.com>


Hello.

I want to make a RSS feed reader in PL/SQL, that gets feeds from one table, parses it and inserts the news into another table.

In order to read the actual feed i need to add a rule for it in the ACL as far as Ive found out, granting resolve and connect to the host. So, if I want to read the feed located at http://news.domain.com/feed/type=rss2 I would grant resolve and connect for the user to host news.domain.com.

Since neighter PL/SQL nor Regular Expressions is my strongest side at the moment, i was wondering if someone could help me to get the following out of the URL;

Protocol : See if it is present, or what protocol it is. That would be everything up too ://.
Host : news.domain.com might just as well be feedme.net (without www or news), so what is the best practice to extract it? Path : Dont know if i realy need it, but it might be cool to have it in as well. I guess the simples solution would be getting everything after the third / if protocol is present, or the first / if it is not.

Any help is appreciated, so thanks in advance :)

-RS- Received on Tue Feb 12 2008 - 03:30:32 CST

Original text of this message