Validate format of email in rails.

Posted by piemesons on Stack Overflow See other posts from Stack Overflow or by piemesons
Published on 2010-05-21T08:44:00Z Indexed on 2010/05/21 8:50 UTC
Read the original article Hit count: 162

Filed under:
|
 validates_format_of :email,
                :with    => /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,
                :message => "is missing or invalid"

Please let me know where is the problem? Is regular expression is wrong?

© Stack Overflow or respective owner

Related posts about validation

Related posts about ruby-on-rails