Solved

regexp in SQL

Posted on 2006-07-12
2
718 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

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 …
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…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

763 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