Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Regular expression

babaraviApr 23 2012 — edited Apr 23 2012
Hi,

Please find the below detail. I want to implement the same logic using regular expression please advise.
SQL>  with t as (
  2                          select 'AAABBB' col1 from dual union all
  3                         select 'AAACCC' from dual union all
  4                         select 'DDDDDD' from dual union all
  5                         select 'ZZZAAA' from dual union all
  6                         select 'KKKKKK' from dual union all
  7                         select 'MMMAAA' from dual
  8                        )
  9   SELECT * FROM t where substr(col1,1,3)<>'AAA' and substr(col1,-3)<>'AAA'
 10  /

COL1
------
DDDDDD
KKKKKK
db detail;
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Regards
Ravikumar.A

Edited by: babaravi on Apr 23, 2012 2:41 PM
This post has been answered by Paul Horth on Apr 23 2012
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 21 2012
Added on Apr 23 2012
10 comments
135 views