Rails 3 - Help with a Email Validation Regex
问题 the following REGEX if provided an email domain that does not match INVALID_EMAILs seems to run indefinitely and lock up the rails server (my local env). INVALID_EMAILS = %w(gmail.com googlemail.com yahoo.com ymail.com rocketmail.com hotmail.com facebook.com) def valid_email_domain(emailAddy) reg = Regexp.new /#{User::INVALID_EMAILS.map{|a| Regexp.quote(a)}.join("|")}/ if emailAddy.scan(reg).size == 0 return true else return false end end Any regex experts out there that can provide feedback?