Skip to content

Instantly share code, notes, and snippets.

@freakflames29
Created April 9, 2021 12:41
Show Gist options
  • Save freakflames29/d5333a8a8d225be0fc8736e22e9d48f8 to your computer and use it in GitHub Desktop.
Save freakflames29/d5333a8a8d225be0fc8736e22e9d48f8 to your computer and use it in GitHub Desktop.
Valid email regex
VALID_EMAIL_REGEX= /^(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})$/i
validates :email , presence: true,uniqueness:{case_sensetive:false},
format:{with:VALID_EMAIL_REGEX,multiline:true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment