Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As told by others, you should check the RFC or the module, or the module code. Anyway, if you are reinventing the wheel to learn something new, I'll tell you how I'd do it in the simplest case: address@some.domain.here First of all, there should be just one "@", and if you want to avoid source routing you should also be sure there are no "%" on the right of the @. you should check that there actually are characters before the @ top level domain should be two, three or four alphabetical chars (or you should get a list of TLD and check for them; guess how -hint: use an hash). you should really have something more than only a top level domain on the right of @: a dot must be there, and there should be at least one alphanumeric character (plus the "-") between @ and the dot Last but not least: no spaces are allowed So, a regexp could be:
This yelds:
Please remember this is only the simplest case!!!, mail addresses syntax is far more complicated than one would expect reading common addresses. The best way to understand it is to try to write a spam filter for personal use :-) Have fun! Ciao!
In reply to Re: email check
by bronto
|
|