im back again.. ive been linked to http://tfletcher.com/lib/rfc822.rb to use for e-mail validation, can someone explain how I use it with a validation statement? right now i have validates_format_of :email, :with => but im not sure how to incorporate it properly.. thanks again! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
use the email_column plugin! It uses tmail::address for most of its lower level stuff and, as far as I can tell, this is part of the ruby action mailer. In your model: include EmailColumn email_column :email and it takes care of the validation -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of releod Sent: Saturday, September 02, 2006 11:12 AM To: Ruby on Rails: Talk Subject: [Rails] email validation im back again.. ive been linked to http://tfletcher.com/lib/rfc822.rb to use for e-mail validation, can someone explain how I use it with a validation statement? right now i have validates_format_of :email, :with => but im not sure how to incorporate it properly.. thanks again! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
cool, works like a charm.. this is the one I was using, I converted it from my php class a few hours ago, also works fairly well. validates_format_of :email, :with => %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.]+)*(\.[a-z]{2,4})$}i I havent had any problems with it when it was PHP so im sure it will be perfect for most people.. let me know if you know of something im forgetting in that regex and ill change it as needed. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> validates_format_of :email, :with => > %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.]+)*(\.[a-z]{2,4})$}iI''m pretty sure that is incorrect. Check out: http://www.norid.no/domenenavnbaser/domreg.html Plus I believe there are military domains that are one character, like ''z'' for the New Zealand military? this one actually really fries me. SO many sites don''t allow me to enter something like temp.email-+o2F97aH/UNjs1FC7lr9PA@public.gmane.org they completly crap out...sometimes it is the period before the ''@'', or two periods after the ''@'', and then the ''.coop'' usually throws most people for a loop. do people a favor and keep this validation loose unless you *really* need to check it. Do you care if the domain is between 2-4 chars? Adam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
releod wrote:> cool, works like a charm.. this is the one I was using, I converted it > from my php class a few hours ago, also works fairly well. > > validates_format_of :email, :with => > %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.]+)*(\.[a-z]{2,4})$}iIt matches "anything you want\na@b.cd". You should use \A and \Z instead of ^ and $. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
njmacinnes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-04 08:25 UTC
Re: email validation
I agree. Check that it has an @ and at least one period somewhere after the @, but don''t waste any more time on it than that. I don''t really see why extensive email validation is necessary. The only reason I can think of is to stop people entering stuff which isn''t a real email address, but of course, that won''t work, because, because someone could quite easily enter dgfhfkar4t463-SuJym5lTd5a/cRkVau4umw@public.gmane.org, which appears perfectly valid to any email validator regexp. So just leave it out... it''s pointless, and you risk excluding legitimate email addresses. -Nathan On 04/09/06, Adam Greene <adam.greene-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > validates_format_of :email, :with => > > %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.]+)*(\.[a-z]{2,4})$}i > > I''m pretty sure that is incorrect. Check out: > http://www.norid.no/domenenavnbaser/domreg.html > > Plus I believe there are military domains that are one character, like > ''z'' for the New Zealand military? > > this one actually really fries me. SO many sites don''t allow me to > enter something like temp.email-+o2F97aH/UNjs1FC7lr9PA@public.gmane.org > > they completly crap out...sometimes it is the period before the ''@'', or > two periods after the ''@'', and then the ''.coop'' usually throws most > people for a loop. > > do people a favor and keep this validation loose unless you *really* > need to check it. Do you care if the domain is between 2-4 chars? > > Adam > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Sep 3, 2006, at 9:59 PM, Adam Greene wrote:>> validates_format_of :email, :with => >> %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.] >> +)*(\.[a-z]{2,4})$}i > > I''m pretty sure that is incorrect. Check out: > http://www.norid.no/domenenavnbaser/domreg.htmlThere is a really nice (and long) regex here that I''ve used in the past. http://www.regular-expressions.info/email.html Robby --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hello, Have you checked validates_as_email plugin: https://svn.greenpeace.org/repositories/rails_plugins/validates_as_email/trunk/README It looks quite easy to use. Personally I am having trouble installing it. If anybody have an idea: ruby script/plugin install https://svn.greenpeace.org/repositories/rails_plugins/validates_as_email c:/ruby/lib/ruby/1.8/net/http.rb:588:in `connect'': certificate verify failed (OpenSSL::SSL ::SSLError) from c:/ruby/lib/ruby/1.8/net/http.rb:588:in `connect'' from c:/ruby/lib/ruby/1.8/net/http.rb:555:in `do_start'' from c:/ruby/lib/ruby/1.8/net/http.rb:544:in `start'' from c:/ruby/lib/ruby/1.8/open-uri.rb:245:in `open_http'' from c:/ruby/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'' from c:/ruby/lib/ruby/1.8/open-uri.rb:167:in `open_loop'' from c:/ruby/lib/ruby/1.8/open-uri.rb:165:in `open_loop'' from c:/ruby/lib/ruby/1.8/open-uri.rb:135:in `open_uri'' ... 11 levels... from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/plugin.rb:871 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/depende ncies.rb:147:in `require'' from script/plugin:3 I have been playing around with soap4r so it could come from there. Did not have time to really look into it but somebody out there might know the answer, Cheers, Carl On 9/4/06, Robby Russell <robby.lists-/Lcn8Y7Ot69QmPsQ1CNsNQ@public.gmane.org> wrote:> > > On Sep 3, 2006, at 9:59 PM, Adam Greene wrote: > > >> validates_format_of :email, :with => > >> %r{^(?:[_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-zA-Z0-9\-\.] > >> +)*(\.[a-z]{2,4})$}i > > > > I''m pretty sure that is incorrect. Check out: > > http://www.norid.no/domenenavnbaser/domreg.html > > There is a really nice (and long) regex here that I''ve used in the past. > > http://www.regular-expressions.info/email.html > > Robby > > > > >-- Carl-Gustaf Harroch --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---