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!

[solved]RegExp_Like Bug?

Aketi JyuuzouJun 20 2006 — edited Nov 4 2010
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE    10.1.0.2.0  Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production

SQL> select Val,
  2  case when RegExp_Like(Val,'(03|12)[12][01then 1 else 0 end as "IsMatch"
  3  from (select '0310' as Val from dual
  4  union select '0311' from dual);

VAL     IsMatch
----  ---------
0310          0
0311          0

SQL> select Val,
  2  case when RegExp_Like(Val,'(03|12)[1-2][0-1then 1 else 0 end as "IsMatch"
  3  from (select '0310' as Val from dual
  4  union select '0311' from dual);

VAL     IsMatch
----  ---------
0310          1
0311          1
Why different?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2010
Added on Jun 20 2006
16 comments
6,512 views