Skip to content

Instantly share code, notes, and snippets.

@n00ge
Created August 2, 2012 13:37
Show Gist options
  • Save n00ge/3237152 to your computer and use it in GitHub Desktop.
Save n00ge/3237152 to your computer and use it in GitHub Desktop.
Email validation
def valid_email?(email)
email =~ /^(|(([a-z0-9]+_+)|([a-z0-9]+\-+)|([a-z0-9]+\.+)|([a-z0-9]+))*[a-z0-9]+@([a-z0-9]{1})(([a-z0-9]+\-+)|([a-z0-9]+\.))*[a-z0-9\-\.]{1,62}\.[a-z]{2,6})$/i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment