REGEXP_LIKE
Position of dot in NOT REGEXP_LIKE(COL3, '[^[:digit:]()+-.surprisingly significant.
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Apr 22 16:18:41 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> CREATE TABLE reg_exp_test(
col1 VARCHAR2(10 BYTE),
col2 VARCHAR2(10 BYTE),
col3 VARCHAR2(10 BYTE)
);
Table created.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col1_ck
CHECK (NOT REGEXP_LIKE(col1, '[^.[:digit:]()+-]')));
Table altered.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col2_ck
CHECK (NOT REGEXP_LIKE(col2, '[^[:digit:].()+-]')));
Table altered.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col3_ck
CHECK (NOT REGEXP_LIKE(col3, '[^[:digit:]()+-.]')));
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Apr 22 16:18:41 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> CREATE TABLE reg_exp_test(
col1 VARCHAR2(10 BYTE),
col2 VARCHAR2(10 BYTE),
col3 VARCHAR2(10 BYTE)
);
Table created.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col1_ck
CHECK (NOT REGEXP_LIKE(col1, '[^.[:digit:]()+-]')));
Table altered.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col2_ck
CHECK (NOT REGEXP_LIKE(col2, '[^[:digit:].()+-]')));
Table altered.
SQL> ALTER TABLE reg_exp_test ADD (
CONSTRAINT col3_ck
CHECK (NOT REGEXP_LIKE(col3, '[^[:digit:]()+-.]')));
0