email syntax validation needed

Randal L. Schwartz merlyn at stonehenge.com
Sun Jun 15 13:50:26 UTC 2003


>>>>> "Derek" == Derek Brans <brans at nerdonawire.com> writes:

Derek> Does anyone have code (or is there any in the image) which, given a string, returns whether or not that string is a syntactically valid email address?

In addition to the other messages in this thread, let me also point out
that the following are valid:

  *@qz.to (my friend, Eli the bearded uses this one)
  fred&barney at stonehenge.com (my example when it comes up - go ahead and test it!)
  merlyn@(that's "at")stonehenge(the rock place (that rocks!)).com(dot com!)

Yes, that last one has *nested* parens.  Therefore, you cannot do this
with a regex, which cannot match nested anythings.

In general, there are no illegal characters, but everything has to appear
in a proper context.

Good luck with your mission. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



More information about the Squeak-dev mailing list