Skip to content

Instantly share code, notes, and snippets.

@rodrigomaia
Created January 30, 2012 11:51
Show Gist options
  • Save rodrigomaia/1704022 to your computer and use it in GitHub Desktop.
Save rodrigomaia/1704022 to your computer and use it in GitHub Desktop.
ReGex Validates
valid_email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, format: { with: valid_email_regex }
font: http://ruby.railstutorial.org/chapters/modeling-users?version=3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment