Re: REGEXP Functions in 10g (10.2.0.2.0)

From: <stevedhoward_at_gmail.com>
Date: Fri, 7 Aug 2009 05:08:19 -0700 (PDT)
Message-ID: <df9fdb81-1362-44ab-a163-f01474164087_at_o36g2000vbl.googlegroups.com>



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> Received on Fri Aug 07 2009 - 07:08:19 CDT

Original text of this message