Oracle 11g – Check constraint with RegEx

A check constraint follows the same syntax rules as conditions for a WHERE clause:

alter table foo
  add constraint check_email 
  check (REGEXP_LIKE(email,'your_regex_goes_here','I')); 

More details in the manual:

Edit:

There are however some restrictions on what you can actually use in a check constraint:

Leave a Comment