From: Steve Wilhelm Date: 2009-11-28T14:40:20+09:00 Subject: Re: Pattern match to fail if two periods in a row Ralph Shnelvar wrote: > Basically ... I need something that will work in a Rails > validates_format_of > > # Reject if the email address has two periods in a row > validates_format_of :email, > # See > http://en.wikipedia.org/wiki/E-mail_address > :with => ????, > :message => 'invalid email format' From http://github.com/alexdunae/validates_email_format_of Regex = Regexp.new('^((' + LocalPartUnquoted + ')|(' + LocalPartQuoted + ')+)@(((\w+\-+[^_])|(\w+\.[^_]))*([a-z0-9-]{1,63})\.[a-z]{2,6}$)', Regexp::EXTENDED | Regexp::IGNORECASE) -- Posted via http://www.ruby-forum.com/.