I'm trying to setup a check constraint to accept email addresses.
So the rule I want to set is to allow this ...
but not this...
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(
constraint email_chk check(regexp_like(email_address, '[[:alpha:]]+@[[:alpha:]]+\.(com|net)')));
insert into email values('firstname.lastname@example.org');