Solved

regexp in SQL

Posted on 2006-07-12
2
717 Views
Last Modified: 2008-02-01
SELECT REGEXP_SUBSTR('Go to http://www.oracle.com/products and click on database',
'http://([[:alnum:]]+\.?){3,4}/?') RESULT
FROM dual;
Can some body explain what this is doing?
output : http://www.oracle.com/


What exactly +, \. , \n  do .
Thanks
0
Comment
Question by:avi_ny
2 Comments
 
LVL 19

Expert Comment

by:actonwang
ID: 17092052
>>http://([[:alnum:]]+\.?){3,4}/?

     it is a reg expression.

     it matches.
     http://  then 3 or 4 set of   alphanumeric charachters ending with . (\. because . is a special character) plus a '/' (optional because of ?).
0
 
LVL 23

Accepted Solution

by:
paquicuba earned 125 total points
ID: 17092634
>>> What exactly +, \. , \n  do .

+   Matches one or more occurrences of the preceding subexpression

\.  Escape Character:  Treat the subsequent metacharacter in the expression as a literal.
                                 Since "." ( dot ) has a special meaning within the context of a regular expression, you
                                 must use "\" (Escape Character) to treat "." (dot) as a literal.

\n  Backreference:  Matches the nth preceding subexpression, where n is an integer from 1 to 9.
 
 
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bash Script to Analyze Oracle Schemas 11 117
PL SQL Search Across Columns 4 52
constraint check 2 48
Oracle - Query link database loop 8 40
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question