create or replace
trigger
  emailFormat
  BEFORE INSERT OR UPDATE ON jezdec
  FOR EACH ROW
  DECLARE
    v_regexp CONSTANT VARCHAR(100) := '^[A-Z0-9._%+-]+@[A-Z0-9.-]+[.][A-Z]{2,4}$';
    v_valid BOOLEAN := FALSE;
  BEGIN
    :NEW.e_mail := TRIM(:NEW.e_mail); -- odstran mezery pred a za emailem
    v_valid := REGEXP_LIKE(:NEW.e_mail, v_regexp, 'i');
    IF (NOT v_valid) THEN
      RAISE_APPLICATION_ERROR(-20207, 'Neplatny format emailove adresy!');
    END IF;
  END emailFormat;
/