David - On 11-Sep-08, at 11:13 AM, Pardee, Roy wrote:
> > Heh--there's actually a famous regexp (if you can imagine such a > thing) that faithfully tracks the RFA spec for e-mail addresses. > It's something like half a printed page long and would make a kick- > ass tattoo. > > I'm writing from the bus, else I'd google up a link to it. > > But lots of much much simpler regexps will handle 99% of valid > addresses. Those are easily googled up... > > -----Original Message----- > From: [email protected] > [mailto:[email protected] > ] On Behalf Of David Liwoch > Sent: Thursday, September 11, 2008 12:40 AM > To: Ruby on Rails: Talk > Subject: [Rails] Re: HowTo search a string for content? > > > Hehe.. definetly a more simple way to do exactly that. Thank you > > Guess Reg Exp can probably define a more accurate pattern for email > validation. > > Thx this is one that works pretty well for us: validates_format_of :email, :with => /[EMAIL PROTECTED] Z0-9.-]+\.[A-Z]{2,4}\b/i, :if => Proc.new { |user| !user.email.blank? && !user.password_being_reset} it might have some holes Jodi --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

