Re: REGEXP Functions in 10g (10.2.0.2.0)

From: admin <admin_at_rbtron.com>
Date: Fri, 7 Aug 2009 08:55:45 -0700 (PDT)
Message-ID: <8baa45a2-c893-46e5-9faf-fc879eae94b5_at_n2g2000vba.googlegroups.com>



On Aug 7, 7:08 am, "stevedhow..._at_gmail.com" <stevedhow..._at_gmail.com> wrote:
> On Aug 6, 4:40 pm, admin <ad..._at_rbtron.com> wrote:
>
>
>
>
>
> > Hi,
>
> > Is there any way to do remove a few lines from a paragraph using
> > regexp functions?
>
> > Something like : sed -e '/temp/,/test/d' text.txt ?
>
> > This is what I need:
>
> > select 'text' title from dual union select 'test' from dual union
> > select 'temp' from dual union select 'doc' from dual;
>
> > TITLE
> > --------------------------
> > doc
> > temp
> > test
> > text
>
> > Required Output after running regexp functions:
>
> > TITLE
> > --------------------------
> > doc
> > text
>
> > ie., remove anything between 'temp' and 'test' (inclusive) ...
>
> > Thanks
>
> > -Ad
>
> How about...
>
> SQL> select title from (
> select 'text' title from dual
> union
> select 'test' from dual
> union
> select 'temp' from dual
> union
> select 'doc' from dual)
> where not regexp_like(title,'^te[m-s]')  2    3    4    5    6    7
> 8    9  ;
>
> TITL
> ----
> doc
> text
>
> SQL>- Hide quoted text -
>
> - Show quoted text -

Steve,

I need it in the select clause itself not in the where condition ... it is actually just 1 row, not 4 separate rows ... probably my "select union" stuff gave you wrong info ... sorry about that ...

Mladen,

Yeah, it is a CLOB column, that I need to "delete" certain lines (not rows as there is only 1 row) that start with "temp" and end with "test" and anything in between.

I can spool it out and run sed -e '/temp/,/test/d' text.txt to get the desired output. I was just wondering if it is possible from within Oracle itself, since 10g now supports a ton of functions ... Received on Fri Aug 07 2009 - 10:55:45 CDT

Original text of this message