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?