I'm trying to setup a check constraint to accept email addresses.
So the rule I want to set is to allow this ...
FirstnameLastname@gmail.com
but not this...
Firstname.Lastname@gmail.com
I want the first and last names to not be split by a period (no '.' appearing before the '@'). I've tried various solutions to no avail and below was my starting point.
drop table email;
create table email(
email_address varchar2(50),
constraint email_chk check(regexp_like(email_address, '[[:alpha:]]+@[[:alpha:]]+\.(com|net)')));
insert into email values('test.test@gmail.net');