Robert Walker wrote:
Marnen Laibow-Koser wrote:
Robert Walker wrote:
Rajinder Yadav wrote:
How can I validate and email address without using complex reg-
ex is
there a simple rails way to do this?
Are you nuts? That's just the sort of thing Regexp was designed
to do.
And, it's not really all that complex.
Yes it is. The *only* correct regexps I am aware of for e-mail
addresses are on the order of a page in length. All shorter regexps
reject some valid e-mail addresses.
Thanks Marnen. I stand corrected.
However, just to clarify, are you saying that Regexp is still the
best
approach? Given that what you're saying is true, which I'm sure it
is,
then I could imagine that performing this validation without using
Regexp would be even more complex and require quite a bit more code.
The best approach is to download a plugin for email validation,
because
someone, somewhere, has already done all the work ;-)
Several some ones...
http://agilewebdevelopment.com/plugins/validates_as_email
http://agilewebdevelopment.com/plugins/validates_as_email_address
http://agilewebdevelopment.com/plugins/validates_email_format_of
--
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.