Solved

regexp in SQL

Posted on 2006-07-12
2
722 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

626 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