Below regex is validating almost all valid and invalid email addresses mentioned at :https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/
Code:
DECLARE
v_email webowner.person.email%TYPE;
v_constant CONSTANT VARCHAR2(300) := '^(([a-zA-Z0-9"_\-])((\.?[a-zA-Z0-9_\/%+="''\-]+)\.?[a-zA-Z0-9+-]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\]))$';
BEGIN
v_email := 'email@domain.com';
if regexp_like(v_email, v_constant) then
pl('YES: ' || v_email);
else
pl('NO: ' || v_email);
end if;
END;
But the condition now arises, it is expecting minimum of 2 characters(in username part before "@") whereas I need to have only one mandatory character.
e.g.
p@domain.com