I want to make an email validation that only accept emails from my college so I wanted to know how to do that.
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, :presence => true,
:format => { :with => email_regex },
:uniqueness => { :case_sensitive => false }
That is currently how my validation looks like so I wanted to know how I could make it only accept .edu type email addresses.
The exact regex is:
Like user482594 mentioned in the comments, just thought I would point out that you need the
\before the..